home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / libs / MMULib.lha / MMULib / Install / Install < prev    next >
Encoding:
Text File  |  2001-06-01  |  77.4 KB  |  3,102 lines

  1. ; $VER: MuInstall 40.9 (31.5.2001)
  2. ; Script to install the MuLib version 42.9
  3. ; © 2000,2001 THOR - Software
  4. ;
  5. ; Based on MMULib_Install 1.1 by Simon N Goodwin
  6. ; (02.06.2000)
  7. ;
  8. ; The installer software is copyrighted © 1993 Amiga Inc.
  9. ; Amiga is a registered trademark of Amiga
  10. ;
  11.  
  12. ;==Procedures==================================================================
  13. ;
  14. ; Some useful procedures follow...
  15. ;
  16.  
  17. ;*************************************************************************
  18. ;** TERMINATE                                **
  19. ;** called upon termination, removes assigns etc,etc,            **
  20. ;*************************************************************************
  21.  
  22. (procedure TERMINATE 
  23.     (makeassign "..MU..")
  24. )
  25.  
  26. ;*************************************************************************
  27. ;** CAT_OLD                                **
  28. ;** concatenate #name to #oldfiles if #target #name exists        **
  29. ;*************************************************************************
  30.  
  31. (procedure P_CAT_OLD #name (
  32.  
  33.     (if (exists (tackon #target #name))
  34.         (set #oldfiles    (cat #oldfiles #name "\n"))
  35.     )
  36.  
  37. ))
  38.  
  39. ;*************************************************************************
  40. ;** COPY_OLD                                **
  41. ;** copy file #name from #target to #stash_old                **
  42. ;*************************************************************************
  43.  
  44. (procedure P_COPY_OLD #name (
  45.  
  46.     (if (exists (tackon #target #name))
  47.         (
  48.             (if (exists (tackon #stash_old #name))
  49.                 (delete (tackon #stash_old #name))
  50.             )
  51.             (copyfiles    (source (tackon #target #name))
  52.                     (dest (tackon #stash_old #name))
  53.             )
  54.         )
  55.     )
  56. ))
  57.  
  58.  
  59. ;*************************************************************************
  60. ;** P_COPYCPU                                **
  61. ;** copy the cpu library #name to #proc-dest                **
  62. ;*************************************************************************
  63.  
  64. (procedure P_COPYCPU #name (
  65.  
  66.     (copyfiles    (prompt    (#cpu-copy #name))
  67.             (help #copy-proclib-help)
  68.             (source ("..MU..:Libs/%s.library" #name))
  69.             (dest #proc-dest)
  70.     )
  71. ))
  72.  
  73. ;*************************************************************************
  74. ;** P_MMUVERSION                            **
  75. ;** set #need-mmuconfig to 1 if the argument is a V40 (MMU) processor    **
  76. ;** library.                                **
  77. ;*************************************************************************
  78.  
  79. (procedure P_MMUVERSION #name (
  80.  
  81.     (if    (exists    (tackon #proc-dest #name))
  82.         (
  83.             (set #libver (/ (getversion (tackon #proc-dest #name)) 65536))
  84.             (if (= #libver 40)
  85.                 (set #need-mmuconfig 1)
  86.             )
  87.         )
  88.     )
  89. ))
  90.  
  91. ;*************************************************************************
  92. ;** P_PATCH_REPLACE                            **
  93. ;** replace the command #rplc by #dest in the startup-sequence        **
  94. ;** found in #startup-path and #user-path                **
  95. ;*************************************************************************
  96.  
  97. (procedure P_PATCH_REPLACE (
  98.  
  99.     (
  100.         (if (exists "t:__tempfile__")
  101.             (run ("C:Delete t:__tempfile__") (safe))
  102.         )
  103.  
  104.         (run ("..MU..:Install/SED FROM \"%s\" TO T:__tempfile__ MATCH \"({}|{#[~;]+[ \\t]}#[~; \\t][/:]|{}#[~; \\t][/:]|{#[~;]+[ \\t]})%s{|[ \\t;]#?}\" CHANGE \"{1}%s{2}\""
  105.             #startup-path #rplc #dest))
  106.  
  107.         (if (exists "t:__tempfile__")
  108.             (run ("C:Copy t:__tempfile__ TO \"%s\"" #startup-path))
  109.             (run ("C:Delete t:__tempfile__") (safe))
  110.         )
  111.  
  112.         (if (<> #user-path #startup-path)
  113.             (if (exists #user-path)
  114.                 (
  115.                     (run ("..MU..:Install/SED FROM \"%s\" TO T:__tempfile__ MATCH \"({}|{#[~;]+[ \\t]}#[~; \\t][/:]|{}#[~; \\t][/:]|{#[~;]+[ \\t]})%s{|[ \\t;]#?}\" CHANGE \"{1}%s{2}\""
  116.                         #user-path #rplc #dest))
  117.  
  118.                     (if (exists "t:__tempfile__")
  119.                         (run ("C:Copy t:__tempfile__ TO \"%s\"" #user-path))
  120.                         (run ("C:Delete t:__tempfile__") (safe))
  121.                     )
  122.                 )
  123.             )
  124.         )
  125.     )
  126. ))
  127.  
  128. ;*************************************************************************
  129. ;** P_PATCH_REMOVE                            **
  130. ;** remove the command #rplc by adding a semicolon in the         **
  131. ;** startup-sequence found in #startup-path and #user-path        **
  132. ;*************************************************************************
  133.  
  134. (procedure P_PATCH_REMOVE (
  135.  
  136.     (
  137.         (if (exists "t:__tempfile__")
  138.             (run ("C:Delete t:__tempfile__") (safe))
  139.         )
  140.  
  141.         (run ("..MU..:Install/SED FROM \"%s\" TO T:__tempfile__ MATCH \"{(|#[~;]+[ \\t]#[~; \\t][/:]|#[~; \\t][/:]|#[~;]+[ \\t])%s(|[ \\t;]#?)}\" CHANGE \";{1}\""
  142.             #startup-path #rplc))
  143.  
  144.         (if (exists "t:__tempfile__")
  145.             (run ("C:Copy t:__tempfile__ TO \"%s\"" #startup-path))
  146.             (run ("C:Delete t:__tempfile__") (safe))
  147.         )
  148.  
  149.         (if (<> #user-path #startup-path)
  150.             (if (exists #user-path)
  151.                 (
  152.  
  153.                     (run ("..MU..:Install/SED FROM \"%s\" TO T:__tempfile__ MATCH \"{(|#[~;]+[ \\t]#[~; \\t][/:]|#[~; \\t][/:]|#[~;]+[ \\t])%s(|[ \\t;]#?)}\" CHANGE \";{1}\""
  154.                         #user-path #rplc))
  155.  
  156.                     (if (exists "t:__tempfile__")
  157.                         (run ("C:Copy t:__tempfile__ TO \"%s\"" #user-path))
  158.                         (run ("C:Delete t:__tempfile__") (safe))
  159.                     )
  160.                 )
  161.             )
  162.         )
  163.     )
  164. ))
  165.  
  166. ;==Strings=====================================================================
  167. ;
  168. ; In the following, we initialize the english strings we might need
  169. ; in a localized version, only the following section must be translated
  170. ;
  171.  
  172. (set #default_lang 1)
  173.  
  174. ; Generic answers
  175. (set #yes "Yes")
  176. (set #no  "No")
  177.  
  178. ; A 68000 or 68010 has been detected, bail out
  179. (set #senseless
  180. (cat "Installation of the MuLib package on a 68000/68010 system does "
  181.      "not make much sense. Abort installation?\n"
  182. ))
  183.  
  184. ; Help message for the above
  185. (set #senseless-help
  186. (cat "Even though the mmu.library will run on a 68000 or 68010 based "
  187.      "systems, installation on these systems does not make much sense "
  188.      "because they do not provide a MMU that is handled and programmed "
  189.      "by this library. Therefore, almost all functions of the mmu.library "
  190.      "will not be available for programs and most of the MuTools will "
  191.      "not work on your system.\n"
  192. )) 
  193.  
  194. ;User selected abortion of the installation.
  195. (set #canceled
  196. (cat "You aborted the installation process."
  197. ))
  198.  
  199. ; Destination disk
  200. (set #which-disk
  201. (cat "On which disk should the MuLib be installed?"
  202. ))
  203.  
  204. ; Destination disk help
  205. (set #which-disk-help
  206. (cat "\nThis section lets you choose in which disk the "
  207.      "MuLib files should be installed. These should normally go in the same "
  208.      "location as the Workbench files, i.e. the boot partition or -disk.\n\n"
  209.      @askdir-help
  210. ))
  211.  
  212. ; Important assigns are missing
  213. (set #no-assign
  214. (cat "\nThe destination has to be a system disk. The drawers S,DEVS,LIBS "
  215.      "and C must exist there.\n\n"
  216. ))
  217.  
  218. ; Directory where old files should be kept
  219. (set #old-name
  220. (cat "OLD"
  221. ))
  222.  
  223. ; Move old files?
  224. (set #move-old
  225. (cat "\n\nDo you want to backup the following files "
  226.      "to the \"%s\" drawer?\n\n%s" 
  227. ))
  228.  
  229. (set #move-old-help
  230. (cat "\nInstalling the MuLib will replace or update some current Workbench "
  231.      "and system files. "
  232.      "In order to preserve any changes you have previously made to these "
  233.      "files, the installation process will copy them to the \"%s\" drawer "
  234.      "where they can be found later on."
  235. ))
  236.  
  237. (set #move-old-copy
  238. (cat "Copy"
  239. ))
  240.  
  241. (set #move-old-skip
  242. (cat "Skip"
  243. ))
  244.  
  245. ; Ask for the source of the installation
  246. (set #ask-mu
  247. (cat "Please locate the MuLib source directory:"
  248. ))
  249.  
  250. (set #ask-mu-help
  251. (cat "Please specify here the directory where you've unpacked the "
  252.      "archive to. The default I selected for you should work in "
  253.      "(almost) all cases, so don't worry about selecting another "
  254.      "source.\n\n"
  255.      @askdir-help
  256. ))
  257.  
  258. (set #where-multiview
  259. (cat "Please pick your prefered AmigaGuide® viewer:"
  260. ))
  261.  
  262. (set #where-multiview-help
  263. (cat "The installer procedure needs to know the path to MultiView or any "
  264.      "other AmigaGuide® browser to show an introductory text to the MuLib "
  265.      "and it's installation. Please use the requester to select it.\n"
  266.      @askfile-help
  267. ))
  268.  
  269. ; Ask user for P5 illnesses
  270. (set #ask-p5
  271. (cat "Do you use a Phase 5 accelerator board?"
  272. ))
  273.  
  274. (set #ask-p5-help
  275. (cat "Unfortunately, Phase 5 choose not to make their boards compatible "
  276.      "to the CBM AutoConfig (tm) standard. This means that some additional "
  277.      "steps have to be performed to install the mmu.library on these boards.\n"
  278.      "Typically, this installation script is able to figure this out itself, "
  279.      "but it might require some help of you to ensure that everything is correct."
  280. ))
  281.  
  282.  
  283. ; Installation of the mmu.library
  284. (set #copy-mmulib
  285. (cat "The mmu.library will be copied to the LIBS: drawer."
  286. ))
  287.  
  288. (set #ask-copy-mmulib
  289. (cat "Install the mmu.library?"
  290. ))
  291.  
  292. (set #ask-mmulib-dest
  293. (cat "Please select the destination for the "
  294.      "mmu.library."
  295. ))
  296.  
  297. (set #copy-mmulib-help
  298. (cat "The mmu.library is used by other parts of the MuLib package "
  299.      "to extend your Amiga's operating system, so that it uses " 
  300.      "memory management to make it more robust and efficient.\n\n"
  301.      "This library is the essential component needed by all "
  302.      "other parts this MuLib package. The other parts are "
  303.      "optional and can be selected at will, once the library is"
  304.      "available.\n"
  305.      "It will occupy approximately 40K of space on your "
  306.      "SYS: partition, and it should go to a location where "
  307.      "the system will be able to find libraries. The recommendation "
  308.      "is to copy it to the LIBS: directory."
  309. ))
  310.  
  311. ; Update of SetPatch strings
  312. (set #ask-patch-setpatch
  313. (cat "Do you want to update SetPatch to determinate and load the correct "
  314.      "processor libraries?"
  315. ))
  316.  
  317. (set #ask-patch-setpatch-help
  318. (cat "The Commodore version of SetPatch will load 68040.library if "
  319.      "it detects a 68040 or later chip; it will not try to load a "
  320.      "processor driver for the 68020 or 68030, and it does not distinguish "
  321.      "between the 68040 and the 68060 processor. Therefore, a 68040 dummy "
  322.      "library is required for 68060 based boards.\n"
  323.      "The updated SetPatch will, instead, load the 680x0.library which in "
  324.      "turn will be able to initialize the correct processor driver.\n"
  325.      "This allows to setup a system in a way that will work regardless of the "
  326.      "available processor, without the need to install or remove processor "
  327.      "libraries."
  328. ))
  329.  
  330. (set #ask-lib0x0-dest
  331. (cat "Where to install the 680x0.library?"
  332. ))
  333.  
  334. (set #ask-lib0x0-dest-help
  335. (cat "The new SetPatch release requires the 680x0.library to detect "
  336.      "the installed processor and to boot the correct processor "
  337.      "driver.\n"
  338.      "The library should go into the LIBS: assign since it is required "
  339.      "very early on bootstrap - namely by SetPatch."
  340. ))
  341.  
  342. (set #ask-setpatch
  343. (cat "Please locate the SetPatch command:"
  344. ))
  345.  
  346. (set #setpatch-is-patched
  347. (cat "The version of SetPatch you are using has been updated already."
  348. ))
  349.  
  350. (set #setpatch-unknown
  351. (cat "The version of SetPatch you are using is unknown to the installation "
  352.      "script and cannot be updated, sorry. Please try to download the 43.6 "
  353.      "edition, or buy Os 3.5 to get the 44.xx editions."
  354. ))
  355.  
  356. (set #copy-new-setpatch
  357. (cat "Installing the new release of SetPatch."
  358. ))
  359.  
  360. (set #copy-lib0x0
  361. (cat "Installing the 680x0.library."
  362. ))
  363.  
  364. ; Installation of the mmu.library based processor libraries
  365.  
  366. (set #which-proclibs
  367. (cat "Replace which processor libraries by MuLib specific libs:"
  368. ))
  369.  
  370. (set #copy-proclib-help
  371. (cat "The MuLib archive comes with new mmu.library based processor "
  372.      "libraries that make use of the functions of the mmu.library "
  373.      "to construct the MMU setup. This has the advantage that these "
  374.      "libraries are typically shorter and use less memory than the "
  375.      "generic libraries. The installation of these libraries is, "
  376.      "however, optional. The mmu.library will work happily on top of "
  377.      "any processor library - this setup might just waste some memory, "
  378.      "but might be easier to setup for exotic or not so well behaived "
  379.      "boards.\n"
  380.      "These libraries should go to the LIBS: directory where they can be "
  381.      "found by either SetPatch or the 680x0.library."
  382. ))
  383.  
  384. (set #ask-proclib
  385. (cat "Replace the processor library by a MuLib specific lib?"
  386. ))
  387.  
  388. (set #ask-proclib-dest
  389. (cat "Where to install the processor driver libraries:"
  390. ))
  391.  
  392. (set #cpu-copy
  393. (cat "Installing the %s.library..."
  394. ))
  395.  
  396. (set #build-config
  397. (cat "Build now the MMU-Configuration file?"
  398. ))
  399.  
  400. (set #build-config-help
  401. (cat "If you installed the MuLib specific processor libraries, "
  402.      "you need to generate a configuration file for the mmu.library "
  403.      "which is required to build the proper MMU setup. This setup file "
  404.      "will be generated automatically by the installation procedure. "
  405. ))
  406.  
  407. (set #overwrite-config
  408. (cat "Overwrite the existing MMU-Configuration file?"
  409. ))
  410.  
  411. (set #ask-config-dest
  412. (cat "Where to install the MMU-Configuration file:"
  413. ))
  414.  
  415. (set #ask-config-help
  416. (cat #build-config-help
  417.      "It should go into the ENVARC: directory. The only alternative "
  418.      "location would be the DEVS: assign.\n"
  419.      "Note that the mmu.library is run very early in your setup, namely "
  420.      "by SetPatch. This requires that the directory you pick now is really "
  421.      "part of the ENVARC: or DEVS: assigns at this stage of the boot up "
  422.      "process."
  423. ))
  424.  
  425. (set #config-copy
  426. (cat "Now installing the MMU-Configuration..."
  427. ))
  428.  
  429. (set #where-startup
  430. (cat "Please locate the active Startup-Sequence:"
  431. ))
  432.  
  433. (set #where-startup-help
  434. (cat "Please click on the file that acts as Startup-Sequence in your "
  435.      "system. I need the true Startup-Sequence, not the User-Startup.\n"
  436.      "The choice presented here by the installer script should be fine "
  437.      "already.\n"
  438.      @askfile-help
  439. ))
  440.  
  441. (set #where-user
  442. (cat "Please locate the active User-Startup:"
  443. ))
  444.  
  445. (set #where-user-help
  446. (cat "Please click on the file that acts as User-Startup in your "
  447.      "system. I need the real User-Startup, not the Startup-Sequence.\n"
  448.      "The choice presented here by the installer script should be fine "
  449.      "already.\n"
  450.      "In case you do not have a User-Startup, please select the "
  451.      "Startup-Sequence again.\n"
  452.      @askfile-help
  453. ))
  454.  
  455. (set #install-bppcfix
  456. (cat "Install and run BPPCFix on startup?"
  457. ))
  458.  
  459. (set #install-bppcfix-help
  460. (cat "BPPCFix is a tiny program provided by Frank Wille which removes "
  461.      "the resident ppc and 68040/68060 libraries from some P5 based boards. "
  462.      "You should run it in case the ppc.library is ROM resident in your "
  463.      "processor board, or if the 68040/68060.library is resident and should "
  464.      "be replaced the MuLib based processor library. "
  465.      "Otherwise, especially if you do not own a P5 board, you may simply skip "
  466.      "this step."
  467. ))
  468.  
  469.  
  470. (set #set-bppcline
  471. (cat "Please edit the BPPCFix command line, check \"HELP...\" for all options:"
  472. ))
  473.  
  474. (set #set-bppcline-help
  475. (cat "The command line picked by the installer will be good enough, typically, "
  476.      "but experts might want to fine-tune it.\n"
  477.      "The following command line switches are known:\n"
  478.      "\nInstall:        Install BPPCFix if it isn't installed already."
  479.      "\nRemove:         Remove BPPCFix (not useful here)."
  480.      "\n040:            Remove resident processor libraries as well."
  481.      "\nReboot:         Reboot the system if BPPCFix is not yet resident."
  482.      "This is not necessary if SetPatch invokes a reboot anyhow."
  483. ))
  484.  
  485. (set #where-bppcfix
  486. (cat "Where to install BPPCFix:"
  487. ))
  488.  
  489. (set #where-bppcfix-help
  490. (cat "Please pick a directory where BPPCFix should be placed. "
  491.      "Note that this directory must be available on startup. By default, "
  492.      "this should be the C: assign.\n"
  493.      @askdir-help
  494. ))
  495.  
  496. (set #fix-bvision
  497. (cat "Adapt the BVisionPPC monitor driver?"
  498. ))
  499.  
  500. (set #fix-cvision
  501. (cat "Adapt the CVisionPPC monitor driver?"
  502. ))
  503.  
  504. (set #fix-bcvision-help
  505. (cat "The BVisionPPC and CVisionPPC CyberGraphics monitor drivers depend unfortunately "
  506.      "on some undocumented internals of the P5 68040 or 68060.libraries. "
  507.      "Therefore, it will fail if used together with the MuLib based "
  508.      "processor libraries unless it is patched to use the p5emu.library "
  509.      "which is build by the P5Init command in the MMU-Configuration.\n"
  510.      "In case you do not own a BVisionPPC or CVisionPPC graphics card, you may simply "
  511.      "ignore this question and proceed."
  512. ))
  513.  
  514. (set #where-bvision
  515. (cat "Where is the BVisionPPC monitor driver:"
  516. ))
  517.  
  518. (set #where-cvision
  519. (cat "Where is the CVisionPPC monitor driver:"
  520. ))
  521.  
  522. (set #where-bvision-help
  523. (cat "Please locate here the BVisionPPC monitor driver to make it MuLib "
  524.      "conformal.\n"
  525.      #fix-bcvision-help
  526.      "\n"
  527.      @askfile-file
  528. ))
  529.  
  530. (set #where-cvision-help
  531. (cat "Please locate here the CVisionPPC monitor driver to make it MuLib "
  532.      "conformal.\n"
  533.      #fix-bcvision-help
  534.      "\n"
  535.      @askfile-file
  536. ))
  537.  
  538. (set #pick-mutools
  539. (cat "Please pick the MuTools you want to install:"
  540. ))
  541.  
  542. (set #pick-mutools-help
  543. (cat "The MuTools are a collection of mmu.library based tools that "
  544.      "replace other non-MuLib-conformal MMU hacks. They are written in "
  545.      "a way such that all of them co-operate nicely.\n"
  546.      "The following tools are available:\n"
  547.      "\nMuFastRom:       Speedup the system by mirroring the kickstart ROM in RAM."
  548.      "\nMuFastZero:      Speedup the system by relocating the first RAM page from"
  549.      "chip RAM to fast RAM."
  550.      "\nMuMove4K:        Startup tool to allow MuFastZero to mirror the system base "
  551.      "library in fast RAM as well if required."
  552.      "\nMuScan:          Prints the MMU setup."
  553.      "\nMuForce:         The version 40 of Mike Sinz' \"Enforcer\" debugging tool."
  554.      "\nMuGuardianAngel: MuForce \"add-on\" tool to detect illegal accesses. This "
  555.      "is a MungWall/GuardianAngel super-set."
  556.      "\nMuOmniSCSIPatch: Makes the Guru-ROM (omniscsi.device) MMU-aware for "
  557.      "virtual memory applications."
  558.      "\nMuSetCacheMode:  MMU table fine tuning tool for experts."
  559.      "\nMuFastChip:      Speedup chip memory accesses for third-party processor "
  560.      "libraries."
  561.      "\nMuEVD:           MuLib driven ShapeShifter video driver."
  562.      "\nMuLockLib:       Load and lock the MuLib in memory on startup."
  563.      "\nMuLink:          MuLib driven code protection post processing tool for "
  564.      "developers."
  565.      "\nMuProtectModules:Write-protects disk-based resident modules loaded by "
  566.      "LoadModule of the same author."
  567.      "\n\n"
  568.      "More about the tools can be found in the specific AmigaGuide files in the "
  569.      "MuTools directory of the MuLib distribution."
  570. ))
  571.  
  572. (set #where-mutools
  573. (cat "Where should I install the MuTools?"
  574. ))
  575.  
  576. (set #where-mutools-help
  577. (cat "Please pick a directory into which the MuTools will be installed. "
  578.      "No sub-directory will be created.\n"
  579.      @askdir-help
  580. ))
  581.  
  582. (set #where-mutool-guide
  583. (cat "Where should I install the MuTools documentation?"
  584. ))
  585.  
  586. (set #where-mutool-guide-help
  587. (cat "Please pick a directory into which the MuTools documentation, i.e. the "
  588.      "manuals in AmigaGuide format, should be installed. No sub-directory "
  589.      "will be created.\n"
  590.      "Typically, you want to keep the documentation along with the tools.\n"
  591.      @askdir-help
  592. ))
  593.  
  594.  
  595. (set #startup-mufastrom
  596. (cat "Shall I run MuFastROM on startup?"
  597. ))
  598.  
  599. (set #startup-mufastrom-help
  600. (cat "MuFastROM is a MuLib based tool that remaps the kickstart ROM "
  601.      "into RAM, hence boosting the system at the cost of 512K of fast "
  602.      "RAM space. It should be run in the startup-sequence."
  603. ))
  604.  
  605. (set #startup-mufastrom-go
  606. (cat "The following command is added to the user-startup:\n"
  607. ))
  608.  
  609. (set #startup-mufastzero
  610. (cat "Shall I run MuFastZero on startup?"
  611. ))
  612.  
  613. (set #startup-mufastzero-help
  614. (cat "MuFastZero is a MuLib based zero page remapper. It will relocate "
  615.      "the first memory page from chip memory to fast memory and will "
  616.      "therefore make interrupt processing a little bit faster. It should "
  617.      "be run in the startup-sequence."
  618. ))
  619.  
  620. (set #remap-exec
  621. (cat "Shall MuFastZero remap SysBase?"
  622. ))
  623.  
  624. (set #remap-exec-help
  625. (cat "In case your system does not come with auto-configurable fast RAM, "
  626.      "the system main library will end up in slow chip memory. This option "
  627.      "will tell MuFastZero to relocate SysBase as well. You do NOT need "
  628.      "this feature if SysBase is in fast memory anyhow.\n"
  629.      "This option requires a preparation phase by means of MuMove4K. MuMove4K "
  630.      "installation will be turned on automatically if you select this option."
  631. ))
  632.  
  633. (set #remap-ssp
  634. (cat "Shall MuFastZero remap the supervisor stack?"
  635. ))
  636.  
  637. (set #remap-ssp-help
  638. (cat "The supervisor stack holds temporary information on interrupt "
  639.      "processing. In case your system does not come with auto-configurable "
  640.      "fast RAM, the supervisor stack will end up in slower chip memory. "
  641.      "This option will tell MuFastZero to relocate the stack as well. "
  642.      "You do NOT need this feature if the supervisor stack is in fast "
  643.      "memory anyhow."
  644. ))
  645.  
  646. (set #startup-mufastzero-go
  647. (cat "The following command is added to the user-startup:\n"
  648. ))
  649.  
  650.  
  651. (set #startup-mumove4k
  652. (cat "Run MuMove4K on startup?"
  653. ))
  654.  
  655. (set #startup-mumove4k-help
  656. (cat "The MuMove4K command is required for the MuFastZero \"FastExec\" "
  657.      "option, i.e. if you picked "Remap SysBase" above in the MuFastZero "
  658.      "installation. It relocates the start of the chip memory by 32K, hence "
  659.      "leaving enough room for the exec.library to be remapped from chip "
  660.      "memory to fast memory. In case you run PrepareEmul for the ShapeShifter "
  661.      "preparation, it must be replaced by MuMove4K as well."
  662. ))
  663.  
  664. (set #prepareemul
  665. (cat "Include the PrepareEmul ShapeShifter setup?"
  666. ))
  667.  
  668. (set #prepareemul-help
  669. (cat "In case you run the ShapeShifter and hence the PrepareEmul program, "
  670.      "please replace this program by MuMove4K and the apropriate options "
  671.      "since MuMove4K is incompatible to PrepareEmul. The apropriate command "
  672.      "line options will be selected for you."
  673. ))
  674.  
  675. (set #edit-mumove4k
  676. (cat "Please edit the MuMove4K command line, check \"HELP...\" for all options:"
  677. ))
  678.  
  679. (set #edit-mumove4k-help
  680. (cat "The following MuMove4K options are available:\n"
  681.      "\nA1200: Compatibility switch for some P5 boards. If it won't boot without "
  682.      "this switch, include it."
  683.      "\nNOREBOOT: Do not reboot the system if MuMove4k is not installed."
  684.      "\nIGNOREVERIFY: Do not wait until all drives completed verification. Required "
  685.      "in case MuMove4K aborts booting frequently due to invalidate partitions."
  686.      "\nPREPAREEMUL: Includes the ShapeShifter PrepareEmul feature."
  687.      "\nREVERSE: Allocate the memory from \"top down\" instead of \"bottom up\"."
  688.      "\nLOWPRI: Lowers the priority of the resident segments.\n"
  689. ))
  690.  
  691. (set #ask-cybfix
  692. (cat "Fix an illegal access in some P5 devices?"
  693. ))
  694.  
  695. (set #ask-cybfix-help
  696. (cat "Some P5 device drivers like the cybscsi.device and the "
  697.      "z3scsi.device, and maybe some more, run an illegal memory access "
  698.      "that will trigger a MuGuardianAngel hit (for good reason!). To avoid "
  699.      "this hit, you are encouraged to install the \"FixCybAccess\" or the "
  700.      "\"FixP5Scsi\" program on startup if you own one of these devices. "
  701.      "It will work around this hit."
  702. ))
  703.  
  704. (set #startup-cybfix-go
  705. (cat "The following command is added to the user-startup:\n"
  706. ))
  707.  
  708. (set #where-cybfix
  709. (cat "Where to install FixCybAccess:"
  710. ))
  711.  
  712. (set #where-fixp5scsi
  713. (cat "Where to install FixP5Scsi:"
  714. ))
  715.  
  716. (set #where-iprefs
  717. (cat "Please locate the IPrefs command:"
  718. ))
  719.  
  720. (set #where-iprefs-help
  721. (cat "The IPrefs release 40.7 (Workbench 3.1) is too low on stack and "
  722.      "may cause crashes or hangs, especially if you use datatypes to provide "
  723.      "a background picture for the workbench. At least, however, it will cause "
  724.      "a lot of (justified!) MuGuardianAngel warnings. This script "
  725.      "checks the IPrefs version and offers a patch for the 40.7 release if it "
  726.      "finds this release active. The Os 3.5 release of IPrefs, i.e. version 44.xx, "
  727.      "does not have this problem and will be safely left alone by the installer."
  728. ))
  729.  
  730. (set #ask-iprefs-patch
  731. (cat "Increase the IPrefs 40.7 stack size to avoid crashes?"
  732. ))
  733.  
  734. (set #where-narrator
  735. (cat "Please locate the narrator.device:"
  736. ))
  737.  
  738. (set #where-narrator-help
  739. (cat "The last narrator device 37.7 (Workbench 2.04) is too low on stack and "
  740.      "may cause some (justified!) MuGuardianAngel warnings. This script "
  741.      "checks the narrator.device version and offers a patch for the 37.7 release if it "
  742.      "finds this release active. If you don't own the narrator.device, you may ignore "
  743.      "this bug fix silently."
  744. ))
  745.  
  746. (set #ask-narrator-patch
  747. (cat "Increase the narrator.device 37.7 stack size?"
  748. ))
  749.  
  750. (set #where-mfm
  751. (cat "Please locate the mfm.device:"
  752. ))
  753.  
  754. (set #where-mfm-help
  755. (cat "The mfm.device 40.9 (Workbench 3.1) is too low on stack and "
  756.      "may cause some (justified!) MuGuardianAngel warnings. This script "
  757.      "checks the mfm.device version and offers a patch for the 40.9 release if it "
  758.      "finds this release active. If you don't own the mfm.device, or own a different "
  759.      "release, you may ignore this bug fix silently. Unfortunately, I can't offer a "
  760.      "patch other releases."
  761. ))
  762.  
  763. (set #ask-mfm-patch
  764. (cat "Increase the mfm.device 40.9 stack size?"
  765. ))
  766.  
  767. (set #fix-omniscsi
  768. (cat "Shall I make the OmniSCSI MMU aware?"
  769. ))
  770.  
  771. (set #fix-omniscsi-help
  772. (cat "The omniscsi.device, part of the Guru-ROM firmware, is "
  773.      "not MMU aware by default which could cause problems in case "
  774.      "virtual memory applications are run. The MuOmniSCSIPatch "
  775.      "program will fix this potential problem if run as part of "
  776.      "the startup process."
  777. ))
  778.  
  779. (set #startup-omniscsi-go
  780. (cat "The following command is added to the user-startup:\n"
  781. ))
  782.  
  783. (set #ask-mufastchip
  784. (cat "Run MuFastChip on startup?"
  785. ))
  786.  
  787. (set #ask-mufastchip-help
  788. (cat "MuFastChip will speed up the chip RAM access on some "
  789.      "machines by selecting a faster caching mode. However, the "
  790.      "MMU setup will be optimal already in case you use one of the "
  791.      "MuLib based processor libraries or the P5 libraries. Futhermore, "
  792.      "MuFastChip will do nothing on 68020 or 68030 based machines.\n"
  793.      "In these cases, installation is not required."
  794. ))
  795.  
  796. (set #startup-mufastchip-go
  797. (cat "The following command is added to the user-startup:\n"
  798. ))
  799.  
  800. (set #ask-muprotect
  801. (cat "Run MuProtectModules on startup?"
  802. ))
  803.  
  804. (set #ask-muprotect-help
  805. (cat "MuProtectModules write-protects disk-based resident modules "
  806.      "that have been made reset-resident by means of the \"LoadModule\" "
  807.      "program of the same author. These modules are typically Os 3.5 "
  808.      "or Os 3.9 libraries or devices that replace otherwise ROM resident "
  809.      "modules.\n"
  810.      "It does not make sense to install MuProtectModules if "
  811.      "LoadModule is not used."
  812. ))
  813.  
  814. (set #startup-muprotect-go
  815. (cat "The following command is added to the user-startup:\n"
  816. ))
  817.  
  818. (set #ask-mulocklib
  819. (cat "Run MuLockLib on startup?"
  820. ))
  821.  
  822. (set #ask-mulocklib-help
  823. (cat "The MuLockLib program is a tiny tool that loads and locks the "
  824.      "mmu.library in memory such that it cannot be flushed. Since the "
  825.      "MuLib based processor libraries load and lock the mmu.library anyhow, "
  826.      "it makes little sense to run MuLockLib with these libraries installed. "
  827.      "If you use, however, some third party libraries, this tool might help "
  828.      "to decrease the loading time of the MuTools by providing the library "
  829.      "right away."
  830. ))
  831.  
  832. (set #startup-mulocklib-go
  833. (cat "The following command is added to the user-startup:\n"
  834. ))
  835.  
  836. (set #ask-muevd
  837. (cat "Install MuEVD into the ShSh video drivers?"
  838. ))
  839.  
  840. (set #ask-muevd-help
  841. (cat "MuEVD is now installed in the selected MuTools directory, "
  842.      "but it is a good idea to make it available to the ShapeShifter "
  843.      "as well by installing it into its video drivers directory."
  844. ))
  845.  
  846. (set #where-muevd
  847. (cat "Please locate the ShapeShifter video driver directory:"
  848. ))
  849.  
  850. (set #ask-muevdset
  851. (cat "Install the MuEVD default preferences?"
  852. ))
  853.  
  854. (set #ask-muevdset-help
  855. (cat "MuEVD keeps its preferences in an editable text file that should be "
  856.      "kept in EnvArc:. By installing its default preferences explicitly, "
  857.      "you have a handy template to edit and adjust its preferences.\n"
  858.      @askdir-help
  859. ))
  860.  
  861. (set #where-muevdset
  862. (cat "Copy the MuEVD preferences into which drawer:"
  863. ))
  864.  
  865. (set #ask-fastieee 
  866. (cat "Install the FastIEEE speedup?"
  867. ))
  868.  
  869. (set #ask-fastieee-help
  870. (cat "FastIEEE is a patch of the mathieeexxxx.libraries in LIBS: that will "
  871.      "speed up these libraries by replacing math instructions that would have "
  872.      "to be emulated on the 68040 or 68060 to a direct jump into the emulation "
  873.      "routine itself. This patch requires that the emulator routines are made "
  874.      "available by the so called \"fpsp.resource\" which has to be build by the "
  875.      "68040 or 68060.library on startup.\n"
  876.      "Since the Os 3.9 (V45) math libraries check for this resource themselves, "
  877.      "FastIEEE is no longer required for the latest Os release."
  878.      "Currently, only the MuLib based processor libraries offer this feature. "
  879.      "You cannot run FastIEEE on any third-party libraries."
  880. ))
  881.  
  882. (set #where-fastieee
  883. (cat "Copy FastIEEE to which directory:"
  884. ))
  885.  
  886. (set #startup-fastieee
  887. (cat "Run FastIEEE on startup?"
  888. ))
  889.  
  890. (set #startup-fastieee-go
  891. (cat "The following command is added to the user-startup:\n"
  892. ))
  893.  
  894. (set #adapt-guide
  895. (cat "Please wait...\nI'm adapting the MMU.guide to the new destination."
  896. ))
  897.  
  898. (set #ask-patch-check 
  899. (cat "Replace popular MMU hacks by the MuTools?"
  900. ))
  901.  
  902. (set #ask-patch-check-help
  903. (cat "This installation procedure is able to check your startup-sequence for "
  904.      "some popular MMU hacks and replaces them by the apropriate MuTools if "
  905.      "installed. Otherwise, the apropriate programs are disabled. Please "
  906.      "check then your startup-sequence for completeness.\n"
  907.      "The following changes are made:\n"
  908.      "SetCPU FastROM, CPU FastROM and QuickROM are replaced by MuFastROM.\n"
  909.      "Enforcer and CyberGuard are replaced by MuForce.\n"
  910.      "GuardianAngel, MemSniff, MungWall and Wipeout are disabled. Please add "
  911.      "MuGuardianAngel by hand yourself.\n"
  912.      "PrepareEmul is disabled. Either, it was replaced by MuMove4K by the "
  913.      "installation process, or you have to modify your startup-sequence yourself "
  914.      "accordingly.\n"
  915.      "SetCacheMode is replaced by MuSetCacheMode.\n"
  916.      "SpeedyChip is replaced by MuFastChip.\n"
  917.      "FastExec is disabled. It has been replaced by MuFastZero by this script, "
  918.      "otherwise, you've to modify your startup-sequence accordingly."
  919. ))
  920.  
  921. (set #replace-quickrom
  922. (cat "Replacing ROM remappers by MuFastROM (this may take a while)..."
  923. ))
  924.  
  925. (set #replace-enforcer
  926. (cat "Replacing Enforcer by MuForce (this may take a while)..."
  927. ))
  928.  
  929. (set #replace-memsniff
  930. (cat "Disabling memory debugging tools (this may take a while)..."
  931. ))
  932.  
  933. (set #replace-prepemul
  934. (cat "Disabling PrepareEmul (this may take a while)..."
  935. ))
  936.  
  937. (set #replace-setcachemode
  938. (cat "Replacing SetCacheMode (this may take a while)..."
  939. ))
  940.  
  941. (set #replace-speedychip
  942. (cat "Replacing SpeedyChip (this may take a while)..."
  943. ))
  944.  
  945. (set #replace-fastexec
  946. (cat "Replacing FastExec  (this may take a while)..."
  947. ))
  948.  
  949. (set #exit-text
  950. (cat "The MuLib installation is now complete.\n"
  951.      "Please edit now your startup-sequence and the "
  952.      "user startup for fine tuning. Consult the MMU.Guide "
  953.      "for further help about the library and its power."
  954. ))
  955.  
  956. ;==Main program starts here====================================================
  957. ;############
  958. ;*** MAIN ***
  959. ;############
  960.  
  961. ;==Get information about this system===========================================
  962. ;
  963. ; Initialize some strings
  964. ;
  965.  
  966. ;==Get information about this system===========================================
  967. ;
  968. ; First, get some information about the system
  969. ;
  970.  
  971. (welcome)
  972.  
  973. ; Kickstart version
  974. (set #kversion (getversion))
  975. (set #kversion (/ #kversion 65536))
  976. (set #user-level @user-level)
  977. (set #cpu (database "cpu"))
  978. (set #fpu (database "fpu"))
  979. (onerror (TERMINATE))
  980.  
  981. ;==Initialize some variables (plus documentation) =============================
  982.  
  983. (set #target         "SYS:")    ;directory to install the files to
  984. (set #musource         "/")    ;directory to take the sources from, assigned to ..MU..:
  985. (set #startup-path    (tackon #target "S/Startup-Sequence")) ;where the startup-sequence can be found
  986. (set #user-path        (tackon #target "S/User-Startup"))
  987. (set #p5mode        0)    ;1 if a P5 board (user is queried about this one)
  988. (set #ppclib        0)    ;1 if ppc.library found
  989. (set #libresident    0)    ;1 if 68040 or 68060 or ppc.library resident
  990. (set #remproc        0)    ;1 if BPPCFix must be run to remove the 040 or 060 lib    
  991. (set #remppc        0)    ;1 if BPPCFix must be run to remove the ppc.library
  992. (set #install-lib     1)    ;1 if mmu.library should be installed
  993. (set #patch-setpatch     0)    ;1 if SetPatch should be patched to use 680x0
  994. (set #lib0x0-installed    0)    ;1 if 680x0.library has been installed
  995. (set #allow-020        1)    ;1 if it makes sense to allow 68020/68030.lib
  996. (set #install-proc     1)    ;install processor libraries?
  997. (set #need-mmuconfig    0)    ;1 if an ENVARC:MMU-Configuration is required
  998. (set #need-bppcfix     0)    ;1 if BPPCFix should be run
  999. (set #need-bcvisionfix    0)    ;1 if the BVisionPPC CGfx driver requires fixing
  1000. (set #need-omniscsifix    0)    ;1 if the muomniscsipatch should be installed
  1001. (set #mulib-proclibs    0)    ;1 if MuLib based processor libraries
  1002. (set #requires-reboot    1)    ;1 if a bppcfix/mumove4k should include a reboot
  1003. (set #new-setpatch    0)    ;1 if setpatch has been patched
  1004. (set #need-mulocklib    1)    ;1 if mulocklib should be installed
  1005.  
  1006. ;==Check whether it makes sense to install the archive at all==================
  1007. (complete 0)
  1008. ;
  1009. ; Check for the processor first
  1010. ;
  1011.  
  1012. (if (patmatch "(68000|68010)" #cpu)
  1013.     (if    (askbool    (prompt #senseless)
  1014.                 (help    #senseless-help)
  1015.                 (default #yes)
  1016.                 (choices #yes #no)
  1017.         )
  1018.         (abort #canceled)
  1019.     )
  1020. )
  1021.  
  1022. ;==Get target drive============================================================
  1023. (complete 3)
  1024. ;
  1025. ; Get the target directory of the installation
  1026. ;
  1027.  
  1028. (set #old_wb "SYS:")
  1029.  
  1030. (set #target (askdir    (prompt #which-disk)
  1031.             (help #which-disk-help)
  1032.             (disk)
  1033.             (default #old_wb)
  1034. ))
  1035.  
  1036. (if (not (and (exists (tackon #target "S/Startup-Sequence"))
  1037.           (exists (tackon #target "DEVS"))
  1038.           (exists (tackon #target "LIBS"))
  1039.           (exists (tackon #target "C"))
  1040.           (exists (tackon #target "Prefs/Env-Archive")) ))
  1041.      (abort #no-assign)
  1042. )
  1043.  
  1044. ;set @default-dest to user selected target
  1045. (set @default-dest #target)
  1046.  
  1047. ;get directory to save old files
  1048. (set #stash_old (tackon #target #old-name))
  1049.  
  1050.  
  1051. ;==Backup old files============================================================
  1052. (complete 6)
  1053. ;
  1054. ; Make a backup of old files
  1055. ;
  1056.  
  1057. (set #startup-sequence  "S/Startup-Sequence")
  1058. (set #lib040        "Libs/68040.library")
  1059. (set #lib060        "Libs/68060.library")
  1060. (set #lib040old        "Libs/68040old.library")
  1061. (set #setpatch        "C/SetPatch")
  1062. (set #mmuconfig        "Prefs/Env-Archive/MMU-Configuration")
  1063. (set #mmuconfig-d    "Devs/MMU-Configuration")
  1064. (set #narrator        "Devs/narrator.device")
  1065. (set #iprefs        "C/IPrefs")
  1066. (set #mfm        "Devs/mfm.device")
  1067. (set #bppcfix        "C/BPPCFix")
  1068. (set #bvision        "Devs/Monitors/BVisionPPC")
  1069. (set #cvision        "Devs/Monitors/CVisionPPC")
  1070. (set #mulib        "Libs/mmu.library")
  1071.  
  1072. ;get all existing files
  1073. (set #oldfiles "")
  1074.  
  1075. (P_CAT_OLD #startup-sequence)
  1076. (P_CAT_OLD #lib040)
  1077. (P_CAT_OLD #lib060)
  1078. (P_CAT_OLD #lib040old)
  1079. (P_CAT_OLD #setpatch)
  1080. (P_CAT_OLD #mmuconfig)
  1081. (P_CAT_OLD #mmuconfig-d)
  1082. (P_CAT_OLD #narrator)
  1083. (P_CAT_OLD #iprefs)
  1084. (P_CAT_OLD #mfm)
  1085. (P_CAT_OLD #bppcfix)
  1086. (P_CAT_OLD #bvision)
  1087. (P_CAT_OLD #cvision)
  1088. (P_CAT_OLD #mulib)
  1089.  
  1090. ;if some oldfiles found
  1091. (if (<> #oldfiles "")
  1092.     (
  1093.             (if     (askbool    (prompt (#move-old #stash_old #oldfiles))
  1094.                     (help (#move-old-help #stash_old))
  1095.                     (choices #move-old-copy #move-old-skip)
  1096.                     (default 1)
  1097.             )
  1098.             (
  1099.                 ; create new directory w icon
  1100.                 (makedir #stash_old (infos))
  1101.                 ; create s and devs subdirectory
  1102.                 (makedir (tackon #stash_old "S"))
  1103.                 (makedir (tackon #stash_old "Libs"))
  1104.                 (makedir (tackon #stash_old "C"))
  1105.                 (makedir (tackon #stash_old "Devs") (infos))
  1106.                 (makedir (tackon #stash_old "Devs/Monitors") (infos))
  1107.                 (makedir (tackon #stash_old "Prefs") (infos))
  1108.                 (makedir (tackon #stash_old "Prefs/Env-Archive") (infos))
  1109.  
  1110.                 (P_COPY_OLD #startup-sequence)
  1111.                 (P_COPY_OLD #lib040)
  1112.                 (P_COPY_OLD #lib060)
  1113.                 (P_COPY_OLD #lib040old)
  1114.                 (P_COPY_OLD #setpatch)
  1115.                 (P_COPY_OLD #mmuconfig)
  1116.                 (P_COPY_OLD #mmuconfig-d)
  1117.                 (P_COPY_OLD #narrator)
  1118.                 (P_COPY_OLD #iprefs)
  1119.                 (P_COPY_OLD #mfm)
  1120.                 (P_COPY_OLD #bppcfix)
  1121.                 (P_COPY_OLD #bvision)
  1122.                 (P_COPY_OLD #cvision)
  1123.                 (P_COPY_OLD #mulib)
  1124.             )
  1125.         )
  1126.     )
  1127. )
  1128.  
  1129. ;==Get installation source=====================================================
  1130. (complete 9)
  1131. ;
  1132. ; if in expert mode, ask the user where to take the source from
  1133. ;
  1134.  
  1135. (set #musource "/")
  1136.  
  1137. (if (> #user-level 1)
  1138.     (set #musource (askdir (prompt #ask-mu)
  1139.                 (help  #ask-mu-help)
  1140.                 (default "/")
  1141.             )
  1142.     )
  1143. )
  1144.  
  1145. (makeassign "..MU.." #musource (safe))
  1146.  
  1147. ;==Get MultiView===============================================================
  1148. (complete 10)
  1149.  
  1150. (set #multiview-path (tackon #target ("Utilities/Multiview")))
  1151.  
  1152. (if (not (exists #multiview-path))
  1153.     (set #multiview-path (tackon #target ("Tools/Multiview")))
  1154. )
  1155.  
  1156. (if (not (exists #multiview-path))
  1157.     (set #multiview-path #target)
  1158. )
  1159.  
  1160. (set #multiview-path    (askfile    (prompt    #where-multiview)
  1161.                     (help #where-multiview-help)
  1162.                     (default #multiview-path)
  1163.             )
  1164. )
  1165.  
  1166. (if (<> #multiview-path "")
  1167.     (run ("\"%s\" ..MU..:Readme.First!" #multiview-path) (safe))
  1168. )
  1169.  
  1170. ;==Get even more information about the system==================================
  1171. (complete 12)
  1172. ;
  1173. ; check for resident libraries and P5 wierdos
  1174. ;
  1175.  
  1176. (set #p5mode        0)
  1177. (set #ppclib        0)
  1178. (set #libresident    0)
  1179. (set #remproc        0)
  1180. (set #remppc        0)
  1181. (set #need-bcvisionfix    0)
  1182.  
  1183. (if (= (run "..MU..:Install/FindResident ppc.library" (safe) ) 0)
  1184.     (
  1185.         (set    #p5mode    1)
  1186.         (set    #ppclib 1)
  1187.         (set    #libresident 1)
  1188.         (set    #remppc 1)
  1189.     )
  1190. )
  1191.  
  1192. (if (= (run "..MU..:Install/FindResident 68040.library" (safe) ) 0)
  1193.     (
  1194.         (set    #p5mode 1)
  1195.         (set    #libresident 1)
  1196.         (set    #remproc 1)
  1197.     )
  1198. )
  1199.  
  1200. (if (= (run "..MU..:Install/FindResident 68060.library" (safe) ) 0)
  1201.     (
  1202.         (set    #p5mode 1)
  1203.         (set    #libresident 1)
  1204.         (set    #remproc 1)
  1205.     )
  1206. )
  1207.  
  1208. (if (= (run "..MU..:Install/FindResident 68060quick.library" (safe) ) 0)
  1209.     (
  1210.         (set    #p5mode 1)
  1211.         (set    #libresident 1)
  1212.         (set    #remproc 1)
  1213.     )
  1214. )
  1215.  
  1216. (if (= (run "..MU..:Install/FindResident BOOT-MMU-Port" (safe) ) 0)
  1217.     (
  1218.         (set    #p5mode 1)
  1219.     )
  1220. )
  1221.  
  1222. (if (= (run "..MU..:Install/FindPort BOOT-MMU-Port" (safe) ) 0)
  1223.     (
  1224.         (set    #p5mode 1)
  1225.     )
  1226. )
  1227.  
  1228. (if (exists (tackon #target "Libs/ppc.library"))
  1229.     (
  1230.         (set    #p5mode 1)
  1231.         (set    #ppclib    1)
  1232.     )
  1233. )
  1234.  
  1235. (if (= (run "..MU..:Install/FindResident CyberstormPPC.IDTag" (safe) ) 0)
  1236.     (
  1237.         (set    #p5mode 1)
  1238.     )
  1239. )
  1240.  
  1241. (if (= (run "..MU..:Install/FindResident CyberstormMK3.IDTag" (safe) ) 0)
  1242.     (
  1243.         (set    #p5mode 1)
  1244.     )
  1245. )
  1246.  
  1247. (if (= (run "..MU..:Install/FindResident BlizzardPPC.IDTag" (safe) ) 0)
  1248.     (
  1249.         (set    #p5mode 1)
  1250.     )
  1251. )
  1252.  
  1253.  
  1254. (if (> #user-level 0)
  1255.     (set #p5mode    (askbool    (prompt    #ask-p5)
  1256.                     (help    #ask-p5-help)
  1257.                     (default #p5mode)
  1258.                     (choices #yes #no)
  1259.             )
  1260.     )
  1261. )
  1262.  
  1263. ;==Install the mmu.library=====================================================
  1264. (complete 16)
  1265. ;
  1266. ; check for the destination directory for the library and ask the user
  1267. ; then copy the library to where it should go
  1268. ;
  1269.  
  1270. (set #install-lib 1)
  1271. (set #lib-dest (tackon #target "LIBS"))
  1272.  
  1273. (if (> #user-level 1)
  1274.     (set #install-lib    (askbool    (prompt    #ask-copy-mmulib)
  1275.                         (help   #copy-mmulib-help)
  1276.                         (default #install-lib)
  1277.                         (choices #yes #no)
  1278.                 )
  1279.     )
  1280. )
  1281.  
  1282. (if (= #install-lib 1)
  1283.     (if (> #user-level 1)
  1284.         (set #lib-dest    (askdir        (prompt #ask-mmulib-dest)
  1285.                         (help    #copy-mmulib-help)
  1286.                         (default #lib-dest)
  1287.                 )
  1288.         )
  1289.     )
  1290. )
  1291.  
  1292. (if (= #lib-dest "")
  1293.     (set #install-lib 0)
  1294. )
  1295.  
  1296. (if (= #install-lib 1)
  1297.     (copyfiles    (prompt    #copy-mmulib)
  1298.             (help    #copy-mmulib-help)
  1299.             (source    "..MU..:Libs/mmu.library")
  1300.             (dest    #lib-dest)
  1301.     )
  1302. )
  1303.  
  1304. ;==Install the SetPatch upgrade================================================
  1305. (complete 19)
  1306. ;
  1307. ; ask the user whether to upgrade setpatch for auto-detecting the right
  1308. ; processor library
  1309. ;
  1310.  
  1311. (set #patch-setpatch 0)
  1312. (set #setpatch-dest (tackon #target "C/SetPatch"))
  1313. (set #lib0x0-dest (tackon #target "LIBS"))
  1314. (set #patch-file "")
  1315. (set #lib0x0-installed 0)
  1316. (set #new-setpatch 0)
  1317.  
  1318. ;
  1319. ; We need the setpatch destination anyhow, so ask about it now
  1320. ;
  1321. (if (> #user-level 1)
  1322.     (set #setpatch-dest    (askfile    (prompt    #ask-setpatch)
  1323.                         (help    #ask-patch-setpatch-help)
  1324.                         (default #setpatch-dest)
  1325.                 )
  1326.     )
  1327. )
  1328.  
  1329. ;
  1330. ;Use default if the reply is nonsense
  1331.  
  1332. (if (= #setpatch-dest "")
  1333.     (
  1334.         (set #patch-setpatch 0)
  1335.         (set #setpatch-dest (tackon #target "C/SetPatch"))
  1336.     )
  1337. )
  1338.  
  1339.  
  1340. (set #patch-setpatch        (askbool    (prompt    #ask-patch-setpatch)
  1341.                         (help    #ask-patch-setpatch-help)
  1342.                         (default #patch-setpatch)
  1343.                         (choices #yes #no)
  1344.                 )
  1345. )
  1346.  
  1347. ; Get the setpatch revision. We need it anyhow.
  1348. (if (exists #setpatch-dest)
  1349.     (
  1350.         (set #setpatch-verrev (getversion #setpatch-dest))
  1351.         (set #setpatch-size   (getsize    #setpatch-dest))
  1352.  
  1353.         (if (= #setpatch-verrev (+ (* 43 65536) 6))
  1354.             (
  1355.                 (set #patch-file "SetPatch.pch")
  1356.             )
  1357.         )
  1358.         (if (= #setpatch-verrev (+ (* 44 65536) 2))
  1359.             (
  1360.                 (set #patch-file "SetPatch_44.pch")
  1361.                 (set #requires-reboot 0)
  1362.             )
  1363.         )
  1364.         (if (= #setpatch-verrev (+ (* 44 65536) 6))
  1365.             (
  1366.                 (set #patch-file "SetPatch_44_6.pch")
  1367.                 (set #requires-reboot 0)
  1368.             )
  1369.         )
  1370.         (if (= #setpatch-verrev (+ (* 44 65536) 13))
  1371.             (
  1372.                 (set #patch-file "SetPatch_44_13.pch")
  1373.                 (set #requires-reboot 0)
  1374.             )
  1375.         )
  1376.         (if (= #setpatch-verrev (+ (* 44 65536) 16))
  1377.             (
  1378.                 (set #patch-file "SetPatch_44_16.pch")
  1379.                 (set #requires-reboot 0)
  1380.             )
  1381.         )
  1382.         (if (AND (= #setpatch-verrev (+ (* 44 65536) 17))
  1383.              (<> #setpatch-size 32988))
  1384.             (
  1385.                 (set #patch-file "SetPatch_44_17.pch")
  1386.                 (set #requires-reboot 0)
  1387.             )
  1388.         )
  1389.  
  1390.         (if (= #setpatch-verrev (+ (* 43 65536) 7))
  1391.             (
  1392.                 (set #patch-file "+")
  1393.             )
  1394.         )
  1395.         (if (= #setpatch-verrev (+ (* 44 65536) 3))
  1396.             (
  1397.                 (set #patch-file "+")
  1398.                 (set #requires-reboot 0)
  1399.             )
  1400.         )
  1401.         (if (= #setpatch-verrev (+ (* 44 65536) 7))
  1402.             (
  1403.                 (set #patch-file "+")
  1404.                 (set #requires-reboot 0)
  1405.             )
  1406.         )
  1407.         (if (= #setpatch-verrev (+ (* 44 65536) 14))
  1408.             (
  1409.                 (set #patch-file "+")
  1410.                 (set #requires-reboot 0)
  1411.             )
  1412.         )
  1413.         (if (AND (= #setpatch-verrev (+ (* 44 65536) 17))
  1414.              (= #setpatch-size 32988))
  1415.             (    
  1416.                 (set #patch-file "+")
  1417.                 (set #requires-reboot 0)
  1418.             )
  1419.         )
  1420.         (if (= #setpatch-verrev (+ (* 44 65536) 18))
  1421.             (
  1422.                 (set #patch-file "+")
  1423.                 (set #requires-reboot 0)
  1424.             )
  1425.         )
  1426.  
  1427.  
  1428.     )
  1429. )
  1430.  
  1431. ;
  1432. ;The installer script found a new SetPatch release
  1433. ;
  1434. (if (= #patch-file "+")
  1435.     (set #new-setpatch 1)
  1436. )
  1437.  
  1438.  
  1439. (if (= #patch-setpatch 1)
  1440.     (
  1441.         (if (> #user-level 1)
  1442.             (set #lib0x0-dest    (askdir    (prompt #ask-lib0x0-dest)
  1443.                             (help    #ask-lib0x0-dest-help)
  1444.                             (default #lib0x0-dest)
  1445.                         )
  1446.             )
  1447.         )
  1448.         (if (= #lib0x0-dest "")
  1449.             (set #patch-setpatch 0)
  1450.         )
  1451.     )
  1452. )
  1453.  
  1454. (if (= #patch-setpatch 1)
  1455.     (
  1456.         (if (= #new-setpatch 1)
  1457.             (
  1458.                 (message #setpatch-is-patched)
  1459.             )
  1460.         )
  1461.         (if (= #patch-file "")
  1462.             (
  1463.                 (message #setpatch-unknown)
  1464.                 (set #patch-setpatch 0)
  1465.             )
  1466.         )
  1467.     )
  1468. )
  1469.  
  1470. (if (= #patch-setpatch 1)
  1471.     (
  1472.  
  1473.         (if (= #new-setpatch 0)
  1474.             (
  1475.  
  1476.                 (run ("..MU..:Fixes/spatch -oT:SetPatch -p..MU..:Fixes/%s \"%s\"" #patch-file #setpatch-dest))
  1477.  
  1478.                 (if (exists "T:SetPatch")
  1479.                     (
  1480.                         (copyfiles    (prompt    #copy-new-setpatch)
  1481.                                 (help #ask-patch-setpatch-help)
  1482.                                 (source "T:SetPatch")
  1483.                                 (dest (pathonly #setpatch-dest))
  1484.                         )
  1485.                         (delete    "T:SetPatch" (safe))
  1486.                         ;note that SetPatch has now been updated
  1487.                         (set #new-setpatch 1)
  1488.                     )
  1489.                     (abort #setpatch-unknown)
  1490.                 )
  1491.             )
  1492.         )
  1493.  
  1494.         (copylib    (prompt #copy-lib0x0)
  1495.                 (help    #ask-patch-setpatch-help)
  1496.                 (source    "..MU..:Libs/680x0.library")
  1497.                 (dest    #lib0x0-dest)
  1498.         )
  1499.  
  1500.         (set #lib0x0-installed 1)
  1501.     )
  1502. )
  1503.  
  1504. ;==Install the processor libraries=============================================
  1505. (complete 22)
  1506. ;
  1507. ; ask the user whether to install the mmu.lib based processor libraries
  1508. ;
  1509.  
  1510.  
  1511. ; try to check whether it makes sense to install the 68020/68030
  1512.  
  1513. (set #allow-020    0)                ;does it make sense to allow 68020/68030.lib
  1514. (set #install-proc 1)                ;install processor libraries?
  1515. (set #proc-dest (tackon #target "LIBS"))    ;where to install them?
  1516. (set #cpu-mask 0)                ;which libraries to install?
  1517.  
  1518. ;
  1519. ; This *requires* a new setpatch. Otherwise, the 020-libs are never loaded.
  1520. ;
  1521. (if (= #new-setpatch 1)
  1522.     (set #allow-020 1)
  1523. )
  1524.  
  1525. (if (= #allow-020 1)
  1526.     (
  1527.  
  1528.         (if (= "68020" #cpu)
  1529.             (set #cpu-mask 1)
  1530.         )
  1531.         (if (= "68030" #cpu)
  1532.             (set #cpu-mask 2)
  1533.         )
  1534.     )
  1535. )
  1536.  
  1537. (if (= "68040" #cpu)
  1538.     (set #cpu-mask 4)
  1539. )
  1540.  
  1541. (if (= "68060" #cpu)
  1542.     (set #cpu-mask 8)
  1543. )
  1544.  
  1545. (if (= #allow-020 1)
  1546.     (    ;68020 and 68030 are an option
  1547.  
  1548.         (if (> #user-level 1)
  1549.             (
  1550.                 (set #cpu-mask    (askoptions    (prompt    #which-proclibs)
  1551.                                 (help    #copy-proclib-help)
  1552.                                 (default #cpu-mask)
  1553.                                 (choices "68020" "68030" "68040" "68060")
  1554.                         )
  1555.                 )
  1556.             )
  1557.         )
  1558.  
  1559.         (if (= #cpu-mask 0)
  1560.             (set #install-proc 0)
  1561.         )
  1562.     )
  1563.     (    ;only 68040 or 68060 library could possibly be installed
  1564.         ;do not give options, but just install the one and only library
  1565.         ;which is useful.    
  1566.         (if (= #cpu-mask 0)
  1567.             (
  1568.                 (set #install-proc 0)
  1569.             )
  1570.             (
  1571.                 (set #install-proc    (askbool    (prompt #ask-proclib)
  1572.                                     (help    #copy-proclib-help)
  1573.                                     (default #install-proc)
  1574.                                     (choices #yes #no)
  1575.                             )
  1576.                 )
  1577.             )
  1578.         )
  1579.     )
  1580. )
  1581.  
  1582. (complete 24)
  1583.  
  1584. (if (= #install-proc 1)
  1585.     (if (> #user-level 1)
  1586.         (set #proc-dest    (askdir        (prompt #ask-proclib-dest)
  1587.                         (help    #copy-proclib-help)
  1588.                         (default #proc-dest)
  1589.                 )
  1590.         )
  1591.     )
  1592.  
  1593.     (if (= #proc-dest "")
  1594.         (set #install-proc 0)
  1595.     )
  1596. )
  1597.  
  1598. ;now copy the selected libraries.
  1599. ;note that we do NOT use copylib as we want to replace libraries with
  1600. ;higher version numbers 
  1601. ;(P5 is V46, even though this version number is an euphemism)
  1602. ;
  1603. (if (= #install-proc 1)
  1604.     (
  1605.         (if (> (bitand #cpu-mask 1) 0)
  1606.             (P_COPYCPU "68020")
  1607.         )
  1608.         (if (> (bitand #cpu-mask 2) 0)
  1609.             (P_COPYCPU "68030")
  1610.         )
  1611.         (if (> (bitand #cpu-mask 4) 0)
  1612.             (P_COPYCPU "68040")
  1613.         )
  1614.         (if (> (bitand #cpu-mask 8) 0)
  1615.             (P_COPYCPU "68060")
  1616.         )
  1617.     )
  1618. )
  1619.  
  1620. ;==Setup an MMU-Configuration==================================================
  1621. (complete 27)
  1622. ;
  1623. ; check whether we need an MMU-Configuration file. If so, generate it now.
  1624. ; This is required if some mmu.library based libraries are present
  1625.  
  1626. (if (= #proc-dest "")
  1627.     (set #proc-dest (tackon #target "LIBS"))
  1628. )
  1629.  
  1630. (set #need-mmuconfig 0)
  1631. (set #mmuconfig-exists 0)
  1632. (set #config-path (tackon #target "Prefs/Env-Archive"))
  1633.  
  1634. ;the following sets the #need-mmuconfig variable as side effect
  1635. (P_MMUVERSION "68020.library")
  1636. (P_MMUVERSION "68030.library")
  1637. (P_MMUVERSION "68040.library")
  1638. (P_MMUVERSION "68060.library")
  1639.  
  1640. ; If we found a MuLib processor library, the BVision driver
  1641. ; must be fixed as well.
  1642. (if (= #need-mmuconfig 1)
  1643.     (
  1644.         (set #mulib-proclibs 1)
  1645.         (set #need-bcvisionfix 1)
  1646.     )
  1647. )
  1648.  
  1649. (if (exists (tackon #target "Prefs/Env-Archive/MMU-Configuration"))
  1650.     (
  1651.         (set #mmuconfig-exists 1)
  1652.         (set #need-mmuconfig 0)
  1653.     )
  1654. )
  1655.  
  1656. (if (exists (tackon #target "Devs/MMU-Configuration"))
  1657.     (
  1658.         (set #mmuconfig-exists 1)
  1659.         (set #config-path (tackon #target "Devs"))
  1660.         (set #need-mmuconfig 0)
  1661.     )
  1662. )
  1663.  
  1664. ;ask the expert user if our choice is all right
  1665. (if (> #user-level 1)
  1666.     (if (= #mmuconfig-exists 1)
  1667.         (set #need-mmuconfig    (askbool    (prompt #overwrite-config)
  1668.                             (help   #build-config-help)
  1669.                             (default #need-mmuconfig)
  1670.                             (choices #yes #no)
  1671.                     )
  1672.         )
  1673.         (set #need-mmuconfig    (askbool    (prompt #build-config)
  1674.                             (help   #build-config-help)
  1675.                             (default #need-mmuconfig)
  1676.                             (choices #yes #no)
  1677.                     )
  1678.         )
  1679.     )
  1680. )
  1681.  
  1682. ;now ask the expert where to put the file if we need it
  1683. (if (= #need-mmuconfig 1)
  1684.     (
  1685.         (if (> #user-level 1)
  1686.             (set #config-path    (askdir    (prompt #ask-config-dest)
  1687.                             (help    #ask-config-help)
  1688.                             (default #config-path)
  1689.                         )
  1690.             )
  1691.         )
  1692.  
  1693.         (if (= #config-path "")
  1694.             (set #need-mmuconfig 0)
  1695.         )
  1696.     )
  1697. )
  1698.  
  1699. (if (= #need-mmuconfig 1)
  1700.     (
  1701.         (if (= #p5mode 1)
  1702.             (set #config-source "..MU..:Envarc/MMU-Configuration.P5")
  1703.             (set #config-source "..MU..:Envarc/MMU-Configuration")
  1704.         )
  1705.         (copyfiles    (prompt    #config-copy)
  1706.                 (source #config-source)
  1707.                 (dest    #config-path)
  1708.                 (newname "MMU-Configuration")
  1709.         )
  1710.  
  1711.         ;in P5 mode, "P5Init" must be copied as well.
  1712.         (if (= #p5mode 1)
  1713.             (
  1714.                 (if (not (exists (tackon #proc-dest "MMU")))
  1715.                     (makedir (tackon #proc-dest "MMU"))
  1716.                 )
  1717.                 (copyfiles    (source "..MU..:Libs/MMU/P5Init")
  1718.                         (dest    (tackon #proc-dest "MMU"))
  1719.                 )
  1720.             )
  1721.         )
  1722.     )
  1723. )    
  1724.  
  1725. ;==Install BPPCFix=============================================================
  1726. (complete 30)
  1727. ;
  1728. ; check whether we need to run BPPCFix to replace the ROM-resident 
  1729. ; P5 libraries by the MMU-Libraries.
  1730.  
  1731. (set #need-bppcfix 0)
  1732. (set #bppc-reboot  1)
  1733. (set #bppcline "BPPCFix Install")
  1734.  
  1735. ;
  1736. ; Now check whether we need to include a reboot.
  1737. ; This goes for i) SetPatch is older than V43 
  1738. ; or ii) NOROMUPDATES is set.
  1739. ; First, we need to locate the startup-sequence
  1740.  
  1741. (set #startup-path (tackon #target "S/Startup-Sequence"))
  1742.  
  1743. (if (> #user-level 1)
  1744.     (set    #startup-path    (askfile    (prompt    #where-startup)
  1745.                         (help #where-startup-help)
  1746.                         (default #startup-path)
  1747.                 )
  1748.     )
  1749. )
  1750.  
  1751. (if (= #startup-path "")
  1752.     (set #startup-path (tackon #target "S/Startup-Sequence"))
  1753. )
  1754.  
  1755. (if (= #requires-reboot 0)    ;assumption: new SetPatch found so far
  1756.     (            ;the following line-noise will filter the startup sequence
  1757.         (if (= 5 (run ("..MU..:Install/SED TO NIL: FROM \"%s\" MATCH \"(#[~;][/: \\t]|)SetPatch+[ \\t](|+[~;]+[ \\t])NOROMUPDATE([; \\t]#?|)\"" #startup-path) (safe)))
  1758.             (set #requires-reboot 1) ;SetPatch run with NOROMUPDATES here.
  1759.         )
  1760.     )
  1761. )
  1762.  
  1763. ; The BPPCFix is required if either the ppc.library is in ROM
  1764. ; or the 68040/68060 library is in ROM.
  1765.  
  1766. (if (= #libresident 1)
  1767.     (
  1768.         (set #need-bppcfix 1)
  1769.         (set #bppcline "BPPCFix Install")
  1770.     )
  1771. )
  1772. (if (= #remproc 1)
  1773.     (
  1774.         (set #need-bppcfix 1)
  1775.         (set #bppcline "BPPCFix Install 040")
  1776.     )
  1777. )
  1778.  
  1779. ;
  1780. ; Add a reboot if this is required.
  1781. (if (= #requires-reboot 1)
  1782.     (set #bppcline (cat #bppcline " Reboot"))
  1783. )
  1784.  
  1785. ; Now ask the expert user whether this is ok.
  1786. (if (> #user-level 1)
  1787.     (set #need-bppcfix    (askbool    (prompt #install-bppcfix)
  1788.                         (help   #install-bppcfix-help)
  1789.                         (default #need-bppcfix)
  1790.                         (choices #yes #no)
  1791.                 )
  1792.     )
  1793. )
  1794.  
  1795. ;Ask the expert about the BPPC command line
  1796. (if (= #need-bppcfix 1)
  1797.     (if (> #user-level 1)
  1798.         (set #bppcline (askstring     (prompt #set-bppcline)
  1799.                         (help   #set-bppcline-help)
  1800.                         (default #bppcline)
  1801.                 )
  1802.         )
  1803.     )
  1804. )
  1805.  
  1806. (if (= #bppcline "")
  1807.     (set #need-bppcfix 0)
  1808. )
  1809.  
  1810. ;Ask the Expert user where to install the BPPCFix
  1811.  
  1812. (set #bppcfix-path (tackon #target "C"))
  1813.  
  1814. (if (= #need-bppcfix 1)
  1815.     (if (> #user-level 1)
  1816.         (set #bppcfix-path     (askdir    (prompt #where-bppcfix)
  1817.                         (help #where-bppcfix-help)
  1818.                         (default #bppcfix-path)
  1819.                         (newpath)
  1820.                 )
  1821.         )
  1822.     )
  1823. )
  1824.  
  1825. (if (= #bppcfix-path "")
  1826.     (set #need-bppcfix 0)        ;...else...
  1827.     (set #bppcline (tackon #bppcfix-path #bppcline))
  1828. )
  1829.  
  1830. ;If we still need to run bppcfix, prepend its command line to the startup-sequence
  1831. (if (= #need-bppcfix 1)
  1832.     (
  1833.         (copyfiles    (source "..MU..:Install/BPPCFix")
  1834.                 (dest #bppcfix-path)
  1835.         )
  1836.         (run ("echo >t:__bppcfix_line__ \"%s\"" #bppcline) (safe))
  1837.         ; the following line copies the Startup sequence to t: removing
  1838.         ; all references to BPPCFix
  1839.         (run ("..MU..:Install/Sed FROM \"%s\" MATCH \"{(#[~;][/: \\t]|)BPPCFix([ ,\\t]#?|)}\" CHANGE \";{1}\" TO t:__tempfile__" #startup-path) (safe))
  1840.         (run ("c:join t:__bppcfix_line__ t:__tempfile__ to \"%s\"" #startup-path))
  1841.         (run ("c:delete t:__bppcfix_line__ t:__tempfile__ QUIET") (safe))
  1842.  
  1843.         ;As the BPPCFix covers now the reboot, we don't need to do it.
  1844.         (set #requires-reboot 0)
  1845.     )
  1846. )
  1847.  
  1848. ;==Install the BVision fix=====================================================
  1849. (complete 35)
  1850. ;
  1851. ; check whether the P5/CGfx BVision monitor driver is in DEVS:Monitors.
  1852. ; If it is and we use the MuLib based processor libraries, we must
  1853. ; hack it to call the p5emu.library instead of the 68040/68060 library.
  1854. ;
  1855.  
  1856. ; The #need-bcvisionfix variable has been set above already.
  1857.  
  1858. (set #bvision-dest    (tackon #target "Devs/Monitors/BVisionPPC"))
  1859. (set #cvision-dest    (tackon #target "Devs/Monitors/CVisionPPC"))
  1860.  
  1861. (if (> #user-level 1)
  1862.     (set #need-bcvisionfix    (askbool    (prompt    #fix-bvision)
  1863.                         (help    #fix-bcvision-help)
  1864.                         (default #need-bcvisionfix)
  1865.                         (choices #yes #no)
  1866.                 )
  1867.     )
  1868. )
  1869.  
  1870. (if (= #need-bcvisionfix 1)
  1871.     (if (> #user-level 1)
  1872.         (
  1873.             (set #bvision-dest     (askfile    (prompt #where-bvision)
  1874.                                 (help    #where-bvision-help)
  1875.                                 (default #bvision-dest)
  1876.                         )
  1877.             )
  1878.  
  1879.             (set #cvision-dest    (askfile    (prompt    #where-cvision)
  1880.                                 (help    #where-cvision-help)
  1881.                                 (default #cvision-dest)
  1882.                         )
  1883.             )
  1884.         )
  1885.     )
  1886. )
  1887.  
  1888. (if (= #need-bcvisionfix 0)
  1889.     (
  1890.         (set #bvision-dest "")
  1891.         (set #cvision-dest "")
  1892.     )
  1893.     (
  1894.         (if (not (exists #bvision-dest))
  1895.             (set #bvision-dest "")
  1896.         )
  1897.         (if (not (exists #cvision-dest))
  1898.             (set #cvision-dest "")
  1899.         )
  1900.     )
  1901. )
  1902.  
  1903. (if (NOT (= #bvision-dest ""))
  1904.     (
  1905.         (run ("..MU..:Fixes/PatchString \"%s\" 68040.library p5emu.library" #bvision-dest))
  1906.         (run ("..MU..:Fixes/PatchString \"%s\" 68060.library p5emu.library" #bvision-dest))
  1907.     )
  1908. )
  1909.  
  1910. (if (NOT (= #cvision-dest ""))
  1911.     (
  1912.         (run ("..MU..:Fixes/PatchString \"%s\" 68040.library p5emu.library" #cvision-dest))
  1913.         (run ("..MU..:Fixes/PatchString \"%s\" 68060.library p5emu.library" #cvision-dest))
  1914.     )
  1915. )
  1916.  
  1917. ;==Install the MuTools=========================================================
  1918. (complete 37)
  1919. ;
  1920. ; ask the user about various tool files
  1921. ;
  1922.  
  1923. ; Define some mask values for convenience and for simpler
  1924. ; reference.
  1925.  
  1926. (set #mufastrom-mask    1)
  1927. (set #mufastzero-mask    2)
  1928. (set #mumove4k-mask    4)
  1929. (set #muscan-mask    8)
  1930. (set #muforce-mask    16)
  1931. (set #mga-mask        32)
  1932. (set #muomniscsi-mask    64)
  1933. (set #musetcache-mask    128)
  1934. (set #mufastchip-mask    256)
  1935. (set #muevd-mask    512)
  1936. (set #mulocklib-mask    1024)
  1937. (set #mulink-mask    2048)
  1938. (set #mmuguide-mask    4096)
  1939. (set #muprotect-mask    8192)
  1940.  
  1941. (set #toolmask #mufastrom-mask)
  1942. (set #toolmask (bitor #toolmask #muscan-mask))
  1943. (set #toolmask (bitor #toolmask #mmuguide-mask))
  1944. ;
  1945. ; Install MuForce, MGA, MuLink,... only in expert mode
  1946. (if (> #user-level 1)
  1947.     (
  1948.         (set #toolmask (bitor #toolmask #muforce-mask))
  1949.         (set #toolmask (bitor #toolmask #mga-mask))
  1950.         (set #toolmask (bitor #toolmask #musetcache-mask))
  1951.         (set #toolmask (bitor #toolmask #mulink-mask))
  1952.     )
  1953. )
  1954.  
  1955. ; Install MuFastChip, MuLockLib only if no MuLib based processor libraries
  1956. ; doesn't make sense otherwise.
  1957. ;
  1958.  
  1959. (set #run-mufastchip 0)        ;run it not by default
  1960.  
  1961. (if (= #mulib-proclibs 0)
  1962.     (
  1963.         (set #toolmask (bitor #toolmask #mulocklib-mask))
  1964.         (set #toolmask (bitor #toolmask #mufastchip-mask))
  1965.         ;
  1966.         ;doesn't make sense on 030 or 020.
  1967.         (if (= #cpu "68040")
  1968.             (set #run-mufastchip 1)
  1969.         )
  1970.         (if (= #cpu "68060")
  1971.             (set #run-mufastchip 1)
  1972.         )
  1973.     )
  1974.     ;...else...
  1975.     ; Install MuFastZero only if MuLib based processor libs are in
  1976.     ; since P5 libs do this by default (I don't, I'm too careful!)
  1977.     (
  1978.         (set #toolmask (bitor #toolmask #mufastzero-mask))
  1979.         (if (> #user-level 1)
  1980.             (set #toolmask (bitor #toolmask #mumove4k-mask))
  1981.         )
  1982.     )
  1983. )
  1984.  
  1985. ; Install MuOmniSCSIPatch only if the omniscsi-device is found
  1986. ;
  1987. (if (= (run "..MU..:Install/FindDevice omniscsi.device" (safe)) 0)
  1988.     (
  1989.         (set #toolmask (bitor #toolmask #muomniscsi-mask))
  1990.     )
  1991. )
  1992.  
  1993. ; Now ask the user whether the choice is fine.
  1994. ;
  1995. (set #toolmask    (askoptions    (prompt    #pick-mutools)
  1996.                 (help #pick-mutools-help)
  1997.                 (choices     "MuFastRom"    "MuFastZero"
  1998.                         "MuMove4K"    "MuScan"
  1999.                         "MuForce"    "MuGuardianAngel"
  2000.                         "MuOmniSCSIPatch" "MuSetCacheMode"
  2001.                         "MuFastChip"    "MuEVD"
  2002.                         "MuLockLib"    "MuLink"
  2003.                         "MMU.guide"    "MuProtectModules"
  2004.                 )
  2005.                 (default #toolmask)
  2006.         )
  2007. )
  2008.  
  2009. ;
  2010. ; Query destionation for guides and files, but only if we have toolmasks
  2011. ;
  2012. (set #mutool-path    (tackon #target "MuTools"))
  2013.  
  2014. (if (<> #toolmask 0)
  2015.     (
  2016.         (set #mutool-path    (askdir    (prompt #where-mutools)
  2017.                         (help #where-mutools-help)
  2018.                         (default #mutool-path)
  2019.                         (newpath)
  2020.                     )
  2021.         )
  2022.     )
  2023. )
  2024.  
  2025. (if (= #mutool-path "")
  2026.     (set #toolmask 0)
  2027.     (if (not (exists #mutool-path))        ;note that this is in the else-part
  2028.         (makedir #mutool-path (infos))
  2029.     )
  2030. )            
  2031.  
  2032. (set #mutool-guide-path    #mutool-path)
  2033.  
  2034. (complete 39)
  2035.  
  2036. (if (<>    #toolmask 0)
  2037.     (
  2038.         (set #mutool-guide-path    (askdir (prompt #where-mutool-guide)
  2039.                         (help #where-mutool-guide-help)
  2040.                         (default #mutool-guide-path)
  2041.                         (newpath)
  2042.                     )
  2043.         )
  2044.     )
  2045. )
  2046.  
  2047. (if (<> #mutool-guide-path "")
  2048.     (if (not (exists #mutool-guide-path))
  2049.         (makedir #mutool-guide-path (infos))
  2050.     )
  2051. )
  2052.  
  2053. ;Now, one after another, install all the tools and documentation.
  2054.  
  2055. ;==Install MuFastROM===========================================================
  2056. (complete 42)
  2057.  
  2058. (if (<> (bitand #toolmask #mufastrom-mask) 0)
  2059.     (
  2060.         (copyfiles    (source    "..MU..:MuTools/MuFastROM")
  2061.                 (dest #mutool-path)
  2062.                 (infos) (noposition)
  2063.         )
  2064.  
  2065.         (if (<> #mutool-guide-path "")
  2066.             (copyfiles    (source "..MU..:MuTools/MuFastROM.guide")
  2067.                     (dest    #mutool-guide-path)
  2068.                     (infos) (noposition)
  2069.             )
  2070.         )
  2071.  
  2072.         (set #run-mufastrom 1)
  2073.         
  2074.         (set #run-mufastrom    (askbool    (prompt #startup-mufastrom)
  2075.                             (help    #startup-mufastrom-help)
  2076.                             (default 1)
  2077.                             (choices #yes #no)
  2078.                     )
  2079.         )
  2080.  
  2081.         (set #mufastrom-cmd "On Protect >NIL:")
  2082.  
  2083.         (if (= #run-mufastrom 1)
  2084.             (startup "MuFastROM"    (prompt (cat #startup-mufastrom-go "MuFastRom " #mufastrom-cmd))
  2085.                         (help #startup-mufastrom-help)
  2086.                         (command ("%s %s" (tackon #mutool-path "MuFastRom") #mufastrom-cmd))
  2087.             )
  2088.         )
  2089.     )
  2090. )
  2091.  
  2092. ;==Install MuFastZero==========================================================
  2093. (complete 45)
  2094.  
  2095. (set #run-mumove4k 0)    ;for later, possibly set to 1
  2096.  
  2097. (if (<> (bitand #toolmask #mufastzero-mask) 0)
  2098.     (
  2099.         (copyfiles    (source    "..MU..:MuTools/MuFastZero")
  2100.                 (dest #mutool-path)
  2101.                 (infos) (noposition)
  2102.         )
  2103.  
  2104.         (if (<> #mutool-guide-path "")
  2105.             (copyfiles    (source "..MU..:MuTools/MuFastZero.guide")
  2106.                     (dest    #mutool-guide-path)
  2107.                     (infos) (noposition)
  2108.             )
  2109.         )
  2110.  
  2111.         (set #run-mufastzero 1)
  2112.         (set #mufastzero-cmd "ON")
  2113.  
  2114. (complete 46)
  2115.  
  2116.         ;ask whether it is ok to run it on startup        
  2117.  
  2118.         (set #run-mufastzero    (askbool    (prompt #startup-mufastzero)
  2119.                             (help    #startup-mufastzero-help)
  2120.                             (default 1)
  2121.                             (choices #yes #no)
  2122.                     )
  2123.         )
  2124.  
  2125.         ;in expert mode, query more startup options
  2126.  
  2127.         (if (and (> #user-level 1) (= #run-mufastzero 1))
  2128.             (
  2129.  
  2130.                 ;remap exec as well?
  2131.                 (if     (= 1    (askbool    (prompt #remap-exec)
  2132.                                 (help #remap-exec-help)
  2133.                                 (default 0)
  2134.                                 (choices #yes #no)
  2135.                         ) 
  2136.                     )
  2137.                     (
  2138.                         (set #toolmask (bitor #toolmask #mumove4k-mask))
  2139.                         (set #run-mumove4k 1)
  2140.                         (set #mufastzero-cmd (cat #mufastzero-cmd " FastExec"))
  2141.                     )
  2142.                 )
  2143.                 ;remap the SSP?
  2144.                 (if    (= 1    (askbool    (prompt #remap-ssp)
  2145.                                 (help #remap-ssp-help)
  2146.                                 (default 0)
  2147.                                 (choices #yes #no)
  2148.                         )
  2149.                     )
  2150.                     (set #mufastzero-cmd (cat #mufastzero-cmd " MoveSSP"))
  2151.         
  2152.                 )
  2153.             )
  2154.         )
  2155.         
  2156.         (set #mufastzero-cmd (cat #mufastzero-cmd " >NIL:"))
  2157.  
  2158.         (if (= #run-mufastzero 1)
  2159.             (startup "MuFastZero"    (prompt (cat #startup-mufastzero-go "MuFastZero " #mufastzero-cmd))
  2160.                         (help #startup-mufastzero-help)
  2161.                         (command ("%s %s" (tackon #mutool-path "MuFastZero") #mufastzero-cmd))
  2162.             )
  2163.         )
  2164.     )
  2165. )
  2166.  
  2167. ;==Install MuMove4K============================================================
  2168. (complete 47)
  2169.  
  2170. (if (<> (bitand #toolmask #mumove4k-mask) 0)
  2171.     (
  2172.         (copyfiles    (source    "..MU..:MuTools/MuMove4K")
  2173.                 (dest #mutool-path)
  2174.                 (infos) (noposition)
  2175.         )
  2176.  
  2177.         (if (<> #mutool-guide-path "")
  2178.             (copyfiles    (source "..MU..:MuTools/MuMove4K.guide")
  2179.                     (dest    #mutool-guide-path)
  2180.                     (infos) (noposition)
  2181.             )
  2182.         )
  2183.  
  2184.         (set #mumove4k-cmd "MuMove4K")
  2185.         (if (= #p5mode 1)
  2186.             (set #mumove4k-cmd (cat #mumove4k-cmd " A1200"))
  2187.         )
  2188.  
  2189.         ;if we require a reboot, do it now.
  2190.         (if (= #requires-reboot 0)
  2191.             (set #mumove4k-cmd (cat #mumove4k-cmd " NoReboot"))
  2192.         )
  2193.  
  2194. (complete 49)
  2195.  
  2196.         ;ask whether we should run it.
  2197.         (if (> #user-level 1)
  2198.             (set #run-mumove4k    (askbool    (prompt #startup-mumove4k)
  2199.                                 (help    #startup-mumove4k-help)
  2200.                                 (default #run-mumove4k)
  2201.                                 (choices #yes #no)
  2202.                         )
  2203.             )
  2204.         )
  2205.  
  2206.         (set #include-prep 0)
  2207.         ;check whether PrepareEmul is run on the startup-sequence
  2208.         ;
  2209.         (if (= 5 (run ("..MU..:Install/SED TO NIL: FROM \"%s\" MATCH \"(#[~;][/: \\t]|)(MuMove4K[ ,\\t]#?|)PrepareEmul([ ,\\t]#?|)\"" #startup-path) (safe)))
  2210.             (set #include-prep 1)
  2211.         )
  2212.  
  2213. (complete 51)
  2214.  
  2215.         ;ask whether we should include the prepareemul-feature
  2216.         ;
  2217.         (if (= #run-mumove4k 1)
  2218.             (
  2219.                 (if     (= 1     (askbool    (prompt #prepareemul)
  2220.                                 (help #prepareemul-help)
  2221.                                 (default 0)
  2222.                                 (choices #yes #no)
  2223.                         )
  2224.                     )
  2225.                     (set #mumove4k-cmd (cat #mumove4k-cmd " PrepareEmul"))
  2226.                 )
  2227.             )
  2228.         )
  2229.  
  2230. (complete 53)
  2231.         
  2232.         ;ask the expert user if the startup line is ok
  2233.         (if (= #run-mumove4k 1)
  2234.             (if (> #user-level 1)
  2235.                 (set #mumove4k-cmd     (askstring    (prompt #edit-mumove4k)
  2236.                                     (help #edit-mumove4k-help)
  2237.                                     (default #mumove4k-cmd)
  2238.                             )
  2239.                 )
  2240.             )
  2241.         )
  2242.  
  2243.         (if (= #mumove4k-cmd "")
  2244.             (set #run-mumove4k 0)
  2245.         )
  2246.  
  2247. (complete 55)
  2248.  
  2249.         ;if we still need to run MuMove4K, install it now
  2250.         (if (= #run-mumove4k 1)
  2251.             (
  2252.                 (set #mumove4k-cmd (tackon #mutool-path #mumove4k-cmd))
  2253.                 (run ("echo >t:__mumove4k_line__ \"%s\"" #mumove4k-cmd) (safe))
  2254.                 ; the following line copies the Startup sequence to t: removing
  2255.                 ; all references to MuMove4k and PrepareEmul
  2256.                 (run ("..MU..:Install/Sed FROM \"%s\" MATCH \"{(#[~;][/: \\t]|)(MuMove4k|PrepareEmul)([ ,\\t]#?|)}\" CHANGE \";{1}\" TO t:__tempfile__" #startup-path) (safe))
  2257.                 (run ("c:join t:__mumove4k_line__ t:__tempfile__ to \"%s\"" #startup-path))
  2258.                 (run ("c:delete t:__mumove4k_line__ t:__tempfile__ QUIET") (safe))
  2259.  
  2260.                 ;As the MuMove4k covers now the reboot, we don't need to do it.
  2261.                 (set #requires-reboot 0)
  2262.             )
  2263.         )
  2264.     )
  2265. )
  2266.  
  2267. ;==Install MuScan==============================================================
  2268. (complete 57)
  2269.  
  2270. (if (<> (bitand #toolmask #muscan-mask) 0)
  2271.     (
  2272.         (copyfiles    (source    "..MU..:MuTools/MuScan")
  2273.                 (dest #mutool-path)
  2274.                 (infos) (noposition)
  2275.         )
  2276.  
  2277.         (if (<> #mutool-guide-path "")
  2278.             (copyfiles    (source "..MU..:MuTools/MuScan.guide")
  2279.                     (dest    #mutool-guide-path)
  2280.                     (infos) (noposition)
  2281.             )
  2282.         )
  2283.     )
  2284. )
  2285.  
  2286. ;==Install MuGuardianAngel=====================================================
  2287. (complete 60)
  2288.  
  2289. (if (<> (bitand #toolmask #mga-mask) 0)
  2290.     (
  2291.         (copyfiles    (source    "..MU..:MuTools/MuGuardianAngel")
  2292.                 (dest #mutool-path)
  2293.                 (infos) (noposition)
  2294.         )
  2295.  
  2296.         (copyfiles    (source    "..MU..:MuTools/MuGuardianAngel_Off")
  2297.                 (dest #mutool-path)
  2298.                 (infos) (noposition)
  2299.         )
  2300.  
  2301.  
  2302.         (if (<> #mutool-guide-path "")
  2303.             (copyfiles    (source "..MU..:MuTools/MuGuardianAngel.guide")
  2304.                     (dest    #mutool-guide-path)
  2305.                     (infos) (noposition)
  2306.             )
  2307.         )
  2308.  
  2309.         ;If MGA is run, we need to install MuForce as well
  2310.         ;
  2311.         (set #toolmask (bitor #toolmask #muforce-mask))
  2312.  
  2313. (complete 62)
  2314.  
  2315.         ;now check whether we need to run FixCybAccess or FixP5Scsi
  2316.         ;
  2317.         (set #need-cybfix 0)
  2318.         (set #need-fixp5scsi 0)
  2319.  
  2320.         (if (= 0 (run ("..MU..:Install/FindDevice cybscsi.device") (safe)))
  2321.             (set #need-cybfix 1)
  2322.             (set #need-fixp5scsi 1)
  2323.         )
  2324.  
  2325.         (if (= 0 (run ("..MU..:Install/FindDevice z3scsi.device") (safe)))
  2326.             (set #need-cybfix 1)
  2327.             (set #need-fixp5scsi 1)
  2328.         )
  2329.  
  2330.         (if (= 0 (run ("..MU..:Install/FindDevice 2060scsi.device") (safe)))
  2331.             (set #need-cybfix 1)
  2332.             (set #need-fixp5scsi 1)
  2333.         )
  2334.  
  2335.         (if (= 0 (run ("..MU..:Install/FindDevice 2040scsi.device") (safe)))
  2336.             (set #need-cybfix 1)
  2337.             (set #need-fixp5scsi 1)
  2338.         )
  2339.  
  2340.         (if (= 0 (run ("..MU..:Install/FindDevice 1260scsi.device") (safe)))
  2341.             (set #need-cybfix 1)
  2342.             (set #need-fixp5scsi 1)
  2343.         )
  2344.  
  2345.         (if (= 0 (run ("..MU..:Install/FindDevice 1240scsi.device") (safe)))
  2346.             (set #need-cybfix 1)
  2347.             (set #need-fixp5scsi 1)
  2348.         )
  2349.  
  2350.  
  2351.         ;this fix might require updateting to more P5 crap...
  2352.         ;
  2353.         (if (> #user-level 1)
  2354.             (set #need-cybfix     (askbool    (prompt #ask-cybfix)
  2355.                                 (help #ask-cybfix-help)
  2356.                                 (default #need-cybfix)
  2357.                                 (choices #yes #no)
  2358.                         )
  2359.             )
  2360.         )
  2361.  
  2362.         (set #cybfix-path (tackon #target "C"))
  2363.  
  2364.         (set #where-string    #where-cybfix)
  2365.         (set #fixstring        "FixCybAccess")
  2366.         (set #gostring        "FixCybAccess >NIL:")
  2367.         (set #startupcmd    "FixCybAccess")
  2368.         (if (= #need-fixp5scsi 1)
  2369.             (
  2370.                 (set #where-string    #where-fixp5scsi)
  2371.                 (set #fixstring        "FixP5Scsi")
  2372.                 (set #gostring        "FixP5Scsi >NIL:")
  2373.                 (set #startupcmd    "FixP5Scsi")
  2374.             )
  2375.         )
  2376.         
  2377.         ;
  2378.         ;ask the user where to put it
  2379.         ;
  2380.         (if (and (= #need-cybfix 1) (> #user-level 1))
  2381.             (set #cybfix-path    (askdir        (prompt #where-string)
  2382.                                 (help #ask-cybfix-help)
  2383.                                 (default #cybfix-path)
  2384.                                 (newpath)
  2385.                         )
  2386.             )
  2387.         )
  2388.  
  2389.         (if (= #cybfix-path "")
  2390.             (set #need-cybfix 0)
  2391.         )
  2392.  
  2393.         (if (= #need-cybfix 1)
  2394.             (startup #fixstring    (prompt (cat #startup-cybfix-go #gostring))
  2395.                         (help #ask-cybfix-help)
  2396.                         (command ("run <>NIL: %s >NIL:" (tackon #cybfix-path #startupcmd)))
  2397.             )
  2398.         )
  2399.  
  2400. (complete 64)
  2401.  
  2402.         ;now check for the IPrefs stack size increasement patch
  2403.         ;    
  2404.         (set #iprefs (tackon #target "C/IPrefs"))
  2405.  
  2406.         (set #patch-iprefs 1)
  2407.         (if (> #user-level 1)
  2408.             (set #patch-iprefs    (askbool    (prompt #ask-iprefs-patch)
  2409.                                 (help #where-iprefs-help)
  2410.                                 (default #patch-iprefs)
  2411.                                 (choices #yes #no)
  2412.                         )
  2413.             )
  2414.         )
  2415.  
  2416.         (if (= #patch-iprefs 1)
  2417.             (if (> #user-level 1)
  2418.                 (set    #iprefs    (askfile    (prompt #where-iprefs)
  2419.                                 (help #where-iprefs-help)
  2420.                                 (default #iprefs)
  2421.                         )
  2422.                 )
  2423.             )
  2424.         )
  2425.  
  2426.         (if (= #iprefs "")
  2427.             (set #patch-iprefs 0)
  2428.         )
  2429.  
  2430.         (if (= #patch-iprefs 1)
  2431.             (
  2432.                 (if (not (exists #iprefs))
  2433.                     (set #patch-iprefs 0)
  2434.                     (if (<> (+ (* 40 65536) 7) (getversion #iprefs))    ;is it iprefs 40.7
  2435.                         (set #patch-iprefs 0)
  2436.                     )
  2437.                 )
  2438.             )
  2439.         )
  2440.  
  2441.         (if (= #patch-iprefs 1)
  2442.             (
  2443.                 (run ("..MU..:Fixes/SPatch -ot:__tempfile__ -p..MU..:Fixes/IPrefs.pch \"%s\"" #iprefs) (safe))
  2444.                 (if (exists "t:__tempfile__")
  2445.                     (
  2446.                         (run ("C:Copy t:__tempfile__ \"%s\"" #iprefs))
  2447.                         (run ("C:Delete t:__tempfile__ QUIET") (safe))
  2448.                     )
  2449.                 )
  2450.             )
  2451.         )
  2452.  
  2453. (complete 66)
  2454.         ;now check for the narrator stack size increasement patch
  2455.         ;    
  2456.         (set #narrator (tackon #target "DEVS/narrator.device"))
  2457.  
  2458.         (set #patch-narrator 0)
  2459.         (if (> #user-level 1)
  2460.             (set #patch-narrator    (askbool    (prompt #ask-narrator-patch)
  2461.                                 (help #where-narrator-help)
  2462.                                 (default #patch-narrator)
  2463.                                 (choices #yes #no)
  2464.                         )
  2465.             )
  2466.         )
  2467.  
  2468.         (if (= #patch-narrator 1)
  2469.             (if (> #user-level 1)
  2470.                 (set    #narrator (askfile    (prompt #where-narrator)
  2471.                                 (help #where-narrator-help)
  2472.                                 (default #narrator)
  2473.                         )
  2474.                 )
  2475.             )
  2476.         )
  2477.  
  2478.         (if (= #narrator "")
  2479.             (set #patch-narrator 0)
  2480.         )
  2481.  
  2482.         (if (= #patch-narrator 1)
  2483.             (
  2484.                 (if (not (exists #narrator))
  2485.                     (set #patch-narrator 0)
  2486.                     (if (<> (+ (* 37 65536) 7) (getversion #narrator))    ;is it iprefs 40.7
  2487.                         (set #patch-narrator 0)
  2488.                     )
  2489.                 )
  2490.             )
  2491.         )
  2492.  
  2493.         (if (= #patch-narrator 1)
  2494.             (
  2495.                 (run ("..MU..:Fixes/SPatch -ot:__tempfile__ -p..MU..:Fixes/narrator.device.pch \"%s\"" #narrator) (safe))
  2496.                 (if (exists "t:__tempfile__")
  2497.                     (
  2498.                         (run ("C:Copy t:__tempfile__ \"%s\"" #narrator))
  2499.                         (run ("C:Delete t:__tempfile__ QUIET") (safe))
  2500.                     )
  2501.                 )
  2502.             )
  2503.         )
  2504.  
  2505. (complete 68)
  2506.  
  2507.         ;now check for the mfm.device stack size increasement patch
  2508.         ;    
  2509.         (set #mfm (tackon #narrator "DEVS/mfm.device"))
  2510.  
  2511.         (set #patch-mfm 0)
  2512.         (if (> #user-level 1)
  2513.             (set #patch-mfm        (askbool    (prompt #ask-mfm-patch)
  2514.                                 (help #where-mfm-help)
  2515.                                 (default #patch-mfm)
  2516.                                 (choices #yes #no)
  2517.                         )
  2518.             )
  2519.         )
  2520.  
  2521.         (if (= #patch-mfm 1)
  2522.             (if (> #user-level 1)
  2523.                 (set    #mfm     (askfile    (prompt #where-mfm)
  2524.                                 (help #where-mfm-help)
  2525.                                 (default #mfm)
  2526.                         )
  2527.                 )
  2528.             )
  2529.         )
  2530.  
  2531.         (if (= #mfm "")
  2532.             (set #patch-mfm 0)
  2533.         )
  2534.  
  2535.         (if (= #patch-mfm 1)
  2536.             (
  2537.                 (if (not (exists #mfm))
  2538.                     (set #patch-mfm 0)
  2539.                     (if (<> (+ (* 40 65536) 9) (getversion #narrator))    ;is it iprefs 40.7
  2540.                         (set #patch-mfm 0)
  2541.                     )
  2542.                 )
  2543.             )
  2544.         )
  2545.  
  2546.         (if (= #patch-mfm 1)
  2547.             (
  2548.                 (run ("..MU..:Fixes/SPatch -ot:__tempfile__ -p..MU..:Fixes/mfmdev.pch \"%s\"" #mfm) (safe))
  2549.                 (if (exists "t:__tempfile__")
  2550.                     (
  2551.                         (run ("C:Copy t:__tempfile__ \"%s\"" #mfm))
  2552.                         (run ("C:Delete t:__tempfile__ QUIET") (safe))
  2553.                     )
  2554.                 )
  2555.             )
  2556.         )
  2557.     )
  2558. )
  2559.  
  2560. ;==Install MuForce=============================================================
  2561. (complete 70)
  2562.  
  2563. (if (<> (bitand #toolmask #muforce-mask) 0)
  2564.     (
  2565.         (copyfiles    (source    "..MU..:MuTools/MuForce")
  2566.                 (dest #mutool-path)
  2567.                 (infos) (noposition)
  2568.         )
  2569.  
  2570.         (copyfiles    (source    "..MU..:MuTools/MuForce_Window")
  2571.                 (dest #mutool-path)
  2572.                 (infos) (noposition)
  2573.         )
  2574.  
  2575.         (copyfiles    (source    "..MU..:MuTools/MuForce_Off")
  2576.                 (dest #mutool-path)
  2577.                 (infos) (noposition)
  2578.         )
  2579.  
  2580.         (if (<> #mutool-guide-path "")
  2581.             (copyfiles    (source "..MU..:MuTools/MuForce.guide")
  2582.                     (dest    #mutool-guide-path)
  2583.                     (infos) (noposition)
  2584.             )
  2585.         )
  2586.     )
  2587. )
  2588.  
  2589. ;==Install MuOmniSCSIPatch=====================================================
  2590. (complete 72)
  2591.  
  2592. (if (<> (bitand #toolmask #muomniscsi-mask) 0)
  2593.     (
  2594.         (copyfiles    (source    "..MU..:MuTools/MuOmniSCSIPatch")
  2595.                 (dest #mutool-path)
  2596.                 (infos) (noposition)
  2597.         )
  2598.  
  2599.         (if (<> #mutool-guide-path "")
  2600.             (copyfiles    (source "..MU..:MuTools/MuOmniSCSIPatch.guide")
  2601.                     (dest    #mutool-guide-path)
  2602.                     (infos) (noposition)
  2603.             )
  2604.         )
  2605.  
  2606.         ;run this in the startup-sequence?    
  2607.         ;
  2608.         (set #run-muomni 0)
  2609.         
  2610.         (if (= 0 (run ("..MU..:Install/FindDevice omniscsi.device") (safe)))
  2611.             (set #run-muomni 1)
  2612.         )
  2613.         
  2614.         (if (> #user-level 1)
  2615.             (set #run-muomni    (askbool     (prompt #fix-omniscsi)
  2616.                                 (help #fix-omniscsi-help)
  2617.                                 (default #run-muomni)
  2618.                                 (choices #yes #no)
  2619.                         )
  2620.             )
  2621.         )
  2622.  
  2623.  
  2624.         (if (= #run-muomni 1)
  2625.             (startup "MuOmniSCSIPatch"    (prompt (cat #startup-omniscsi-go "MuOmniSCSIPatch >NIL:"))
  2626.                             (help #fix-omniscsi-help)
  2627.                             (command ("%s >NIL:" (tackon #mutool-path "MuOmniSCSIPatch")))
  2628.             )
  2629.         )
  2630.     )
  2631. )
  2632.  
  2633. ;==Install MuSetCacheMode======================================================
  2634. (complete 75)
  2635.  
  2636. (if (<> (bitand #toolmask #musetcache-mask) 0)
  2637.     (
  2638.         (copyfiles    (source    "..MU..:MuTools/MuSetCacheMode")
  2639.                 (dest #mutool-path)
  2640.                 (infos) (noposition)
  2641.         )
  2642.  
  2643.         (if (<> #mutool-guide-path "")
  2644.             (copyfiles    (source "..MU..:MuTools/MuSetCacheMode.guide")
  2645.                     (dest    #mutool-guide-path)
  2646.                     (infos) (noposition)
  2647.             )
  2648.         )
  2649.     )
  2650. )
  2651.  
  2652. ;==Install MuFastChip==========================================================
  2653. (complete 77)
  2654.  
  2655. (if (<> (bitand #toolmask #mufastchip-mask) 0)
  2656.     (
  2657.         (copyfiles    (source    "..MU..:MuTools/MuFastChip")
  2658.                 (dest #mutool-path)
  2659.                 (infos) (noposition)
  2660.         )
  2661.  
  2662.         (if (<> #mutool-guide-path "")
  2663.             (copyfiles    (source "..MU..:MuTools/MuFastChip.guide")
  2664.                     (dest    #mutool-guide-path)
  2665.                     (infos) (noposition)
  2666.             )
  2667.         )
  2668.         
  2669.         ;run-mufastchip was setup at the tool
  2670.         ;selection window.
  2671.         ;
  2672.         (if (> #user-level 1)
  2673.             (set    #run-mufastchip    (askbool    (prompt #ask-mufastchip)
  2674.                                 (help #ask-mufastchip-help)
  2675.                                 (default #run-mufastchip)
  2676.                                 (choices #yes #no)
  2677.                         )
  2678.             )
  2679.         )
  2680.  
  2681.         (if (= #run-mufastchip 1)
  2682.             (startup "MuFastChip"        (prompt (cat #startup-mufastchip-go "MuFastChip ON >NIL:"))
  2683.                             (help #ask-mufastchip-help)
  2684.                             (command ("%s ON >NIL:" (tackon #mutool-path "MuFastChip")))
  2685.             )
  2686.         )
  2687.     )
  2688. )
  2689.  
  2690. ;==Install MuProtectModules=======================================================
  2691. (complete 79)
  2692.  
  2693. (if (<> (bitand #toolmask #muprotect-mask) 0)
  2694.     (
  2695.         (copyfiles    (source    "..MU..:MuTools/MuProtectModules")
  2696.                 (dest #mutool-path)
  2697.                 (infos) (noposition)
  2698.         )
  2699.  
  2700.         (if (<> #mutool-guide-path "")
  2701.             (copyfiles    (source "..MU..:MuTools/MuProtectModules.guide")
  2702.                     (dest    #mutool-guide-path)
  2703.                     (infos) (noposition)
  2704.             )
  2705.         )
  2706.         
  2707.         ;run-muprotectmodules was setup at the tool
  2708.         ;selection window.
  2709.         ;
  2710.         (if (> #user-level 1)
  2711.             (set    #run-muprotect    (askbool    (prompt #ask-muprotect)
  2712.                                 (help #ask-muprotect-help)
  2713.                                 (default #run-muprotect)
  2714.                                 (choices #yes #no)
  2715.                         )
  2716.             )
  2717.         )
  2718.  
  2719.         (if (= #run-muprotect 1)
  2720.             (startup "MuProtectModules"    (prompt (cat #startup-muprotect-go "MuProtectModules ON >NIL:"))
  2721.                             (help #ask-muprotect-help)
  2722.                             (command ("%s ON >NIL:" (tackon #mutool-path "MuProtectModules")))
  2723.             )
  2724.         )
  2725.     )
  2726. )
  2727.  
  2728. ;==Install MuEVD===============================================================
  2729. (complete 81)
  2730.  
  2731. (if (<> (bitand #toolmask #muevd-mask) 0)
  2732.     (
  2733.         (copyfiles    (source    "..MU..:MuTools/MuEVD")
  2734.                 (dest #mutool-path)
  2735.                 (infos) (noposition)
  2736.         )
  2737.  
  2738.         (if (<> #mutool-guide-path "")
  2739.             (copyfiles    (source "..MU..:MuTools/MuEVD.guide")
  2740.                     (dest    #mutool-guide-path)
  2741.                     (infos) (noposition)
  2742.             )
  2743.         )
  2744.         
  2745.         ;now as the user whether to install MuEVD in the shapeshifter
  2746.         ;directory.
  2747.  
  2748.         (set #shsh-install    (askbool    (prompt #ask-muevd)
  2749.                             (help #ask-muevd-help)
  2750.                             (default 0)
  2751.                             (choices #yes #no)
  2752.                     )
  2753.         )
  2754.  
  2755.         (if (= #shsh-install 1)
  2756.             (set    #shsh-path    (askdir    (prompt #where-muevd)
  2757.                             (help #ask-muevd-help)
  2758.                             (default #target)
  2759.                         )
  2760.             )
  2761.         )
  2762.  
  2763.         (if (= #shsh-path "")
  2764.             (set    #shsh-install    0)
  2765.         )
  2766.         
  2767.         (if (= #shsh-install 1)
  2768.             (copyfiles    (source    "..MU..:MuTools/MuEVD.guide")
  2769.                     (dest    #shsh-path)
  2770.                     (infos) (noposition)
  2771.             )
  2772.         )
  2773.  
  2774.         ;Now copy the preferences
  2775.         ;
  2776.         (if (= #config-path "")
  2777.             (set    #config-path    (tackon #target    "Prefs/Env-Archive"))
  2778.         )
  2779.  
  2780.         (if (= #shsh-install 1)
  2781.             (if (> #user-level 1)
  2782.                 (set #shsh-install    (askbool    (prompt #ask-muevdset)
  2783.                                     (help #ask-muevdset-help)
  2784.                                     (default #shsh-install)
  2785.                                     (choices #yes #no)
  2786.                             )
  2787.                 )
  2788.             )
  2789.         )
  2790.  
  2791.         (if (= #shsh-install 1)
  2792.             (if (> #user-level 1)
  2793.                 (set #config-path    (askdir        (prompt    #where-muevdset)
  2794.                                     (help    #ask-muevdset-help)
  2795.                                     (default #config-path)
  2796.                             )
  2797.                 )
  2798.             )
  2799.         )
  2800.  
  2801.         (if (= #config-path "")
  2802.             (set #shsh-install 0)
  2803.         )
  2804.  
  2805.         (if (= #shsh-install 1)
  2806.             (copyfiles    (source    "..MU..:EnvArc/MuEVD.prefs")
  2807.                     (dest    #config-path)
  2808.             )
  2809.         )
  2810.     )
  2811. )
  2812.  
  2813. ;==Install MuLockLib===========================================================
  2814. (complete 83)
  2815.  
  2816. (if (<> (bitand #toolmask #mulocklib-mask) 0)
  2817.     (
  2818.         (copyfiles    (source "..MU..:MuTools/MuLockLib")
  2819.                 (dest #mutool-path)
  2820.         )
  2821.  
  2822.         (if (<> #mutool-guide-path "")
  2823.             (copyfiles    (source "..MU..:MuTools/MuLockLib.readme")
  2824.                     (dest #mutool-guide-path)
  2825.                     (infos) (noposition)
  2826.             )
  2827.         )
  2828.  
  2829.         (if (= #mulib-proclibs 1)
  2830.             (set #need-mulocklib 0)    ;MuLib based libraries: MuLockLib not required
  2831.             (set #need-mulocklib 1) ;..else yes...
  2832.         )
  2833.  
  2834.         (if (> #user-level 1)
  2835.             (set #need-mulocklib    (askbool    (prompt #ask-mulocklib)
  2836.                                 (help #ask-mulocklib-help)
  2837.                                 (default #need-mulocklib)
  2838.                                 (choices #yes #no)
  2839.                         )
  2840.             )
  2841.         )
  2842.  
  2843.         (if (= #need-mulocklib 1)
  2844.             (startup "MuLockLib"        (prompt (cat #startup-mulocklib-go "MuLockLib >NIL:"))
  2845.                             (help #ask-mulocklib-help)
  2846.                             (command ("%s >NIL:" (tackon #mutool-path "MuLockLib")))
  2847.             )
  2848.         )
  2849.     )
  2850. )
  2851.  
  2852. ;==Install MuLink==============================================================
  2853. (complete 85)
  2854.  
  2855. (if (<> (bitand #toolmask #mulink-mask) 0)
  2856.     (
  2857.         (copyfiles    (source    "..MU..:MuTools/MuLink")
  2858.                 (dest #mutool-path)
  2859.         )
  2860.         (copyfiles    (source    "..MU..:MuTools/MuOVLYMGR")
  2861.                 (dest #mutool-path)
  2862.         )
  2863.  
  2864.         (if (<> #mutool-guide-path "")
  2865.             (copyfiles    (source "..MU..:MuTools/MuLink.readme")
  2866.                     (dest    #mutool-guide-path)
  2867.                     (infos) (noposition)
  2868.             )
  2869.         )
  2870.     )
  2871. )
  2872.  
  2873. ;==Install the MMU.guide=======================================================
  2874. (complete 87)
  2875.  
  2876. (if (<> (bitand #toolmask #mmuguide-mask) 0)
  2877.     (
  2878.         ;copy the mmu.guide and patch in the right path.
  2879.  
  2880.         (if (<> #mutool-guide-path "")
  2881.             (
  2882.                 (working #adapt-guide)
  2883.                 (run ("..MU..:Install/SED FROM ..MU..:MMU.guide TO t:MMU.guide MATCH \"{#?}MuTools/{#?.guide/MAIN\\}#?}\" CHANGE \"{1}%s/{2}\"" #mutool-guide-path) (safe))
  2884.                 (run ("C:Copy ..MU..:MMU.guide.info to t:MMU.guide.info") (safe))
  2885.                 (copyfiles    (source    "t:MMU.guide")
  2886.                         (dest    #mutool-guide-path)
  2887.                         (infos) (noposition)
  2888.                 )
  2889.                 (run ("C:Delete t:MMU.guide t:MMU.guide.info QUIET") (safe))
  2890.             )    
  2891.         )
  2892.     )
  2893. )
  2894.  
  2895. ;
  2896. ; all MuTools are now "in".
  2897. ;
  2898. ;==Install FastIEEE============================================================
  2899. (complete 90)
  2900. ;
  2901. ; Check whether we may install FastIEEE. This is the case
  2902. ; for i) MuLib processor libraries and ii) not Carsten's 40.17 68060.library
  2903. ; and iii) the mathieee version is not 45 (because it has FastIEEE build-in)
  2904. ;
  2905.  
  2906. (set #fastieee-possible 1)
  2907.  
  2908. (if (= #mulib-proclibs 0)
  2909.     (set #fastieee-possible 0)
  2910. )
  2911.  
  2912. (set #lib060    (tackon #target "LIBS/68060.library"))
  2913. (set #libieee    (tackon #target "LIBS/mathieeedoubbas.library"))
  2914.  
  2915. (if (= #fastieee-possible 1)
  2916.     (if (= #cpu "68060")
  2917.         (if (exists #lib060)
  2918.             (if (= (+ (* 40 65536) 17) (getversion #lib060))
  2919.                 (set #fastieee-possible 0) ;Carsten doesn't do the fpsp.resource
  2920.             )
  2921.         )
  2922.     )
  2923. )
  2924.  
  2925. (if (= #fastieee-possible 1)
  2926.     (if (exists #libieee)
  2927.         (if (= 45 (/ (getversion #libieee) 65536))
  2928.             (set #fastieee-possible 0)    ;no need to add FastIEEE in V45
  2929.         )
  2930.     )
  2931. )
  2932.     
  2933.  
  2934. (if (> #user-level 1) 
  2935.     (set    #fastieee-possible    (askbool    (prompt #ask-fastieee)
  2936.                             (help    #ask-fastieee-help)
  2937.                             (default #fastieee-possible)
  2938.                             (choices #yes #no)
  2939.                     )
  2940.     )
  2941. )
  2942.  
  2943. (set #fastieee-dest (tackon #target "C"))
  2944.  
  2945. (if (and (= #fastieee-possible 1) (> #user-level 1))
  2946.     (set    #fastieee-dest        (askdir        (prompt #where-fastieee)
  2947.                             (help #ask-fastieee-help)
  2948.                             (default #fastieee-dest)
  2949.                     )
  2950.     )
  2951. )
  2952.  
  2953. (if (= #fastieee-dest "")
  2954.     (set #fastieee-possible 0)
  2955. )
  2956.  
  2957. (if (= #fastieee-possible 1)
  2958.     (copyfiles            (source "..MU..:Install/FastIEEE")
  2959.                     (dest #fastieee-dest)
  2960.                     (files)
  2961.     )
  2962. )
  2963.  
  2964. (set #run-fastieee #fastieee-possible)
  2965.  
  2966. (if (= #fastieee-possible 1)
  2967.     (set    #run-fastieee        (askbool    (prompt #startup-fastieee)
  2968.                             (help    #ask-fastieee-help)
  2969.                             (default #run-fastieee)
  2970.                             (choices #yes #no)
  2971.                     )
  2972.     )
  2973. )
  2974.  
  2975. (set #fastieee-cmd (tackon #fastieee-dest "FastIEEE"))
  2976.  
  2977. (if (= #run-fastieee 1)
  2978.     (startup    "FastIEEE"    (prompt    (cat #startup-fastieee-go #fastieee-cmd))
  2979.                     (help #ask-fastieee-help)
  2980.                     (command #fastieee-cmd)
  2981.     )
  2982. )
  2983.  
  2984. ;
  2985. ;==Check for MMU patches=======================================================
  2986. (complete 94)
  2987. ;
  2988. ; Checks now for some (but not all) popular MMU hacks and disables them
  2989. ;
  2990.  
  2991. (set #patch-check 1)
  2992. (if (> #user-level 1)
  2993.     (set #patch-check    (askbool    (prompt #ask-patch-check)
  2994.                         (help #ask-patch-check-help)
  2995.                         (default #patch-check)
  2996.                         (choices #yes #no)
  2997.                 )
  2998.     )
  2999. )
  3000.  
  3001. (if (= #patch-check 1)
  3002.     (
  3003.  
  3004.         (set #user-path (tackon #target "S/User-Startup"))
  3005.  
  3006.         (if (> #user-level 1)
  3007.             (set    #user-path    (askfile    (prompt    #where-user)
  3008.                                 (help #where-user-help)
  3009.                                 (default #user-path)
  3010.                         )
  3011.             )
  3012.         )
  3013.  
  3014.         (if (= #user-path "")
  3015.             (set #user-path (tackon #target "S/User-Startup"))
  3016.         )
  3017.  
  3018.         (working #replace-quickrom)
  3019.  
  3020.         (set #rplc "(QuickROM|(Set|)CPU+[ \\t](|+[~;]+[ \\t])FastROM)")
  3021.  
  3022.         (if (<> (bitand #toolmask #mufastrom-mask) 0)
  3023.             (
  3024.                 (set #dest (tackon #mutool-path "MuFastROM \\>NIL: PROTECT ON;"))
  3025.                 (P_PATCH_REPLACE)
  3026.             )
  3027.             (
  3028.                 (P_PATCH_REMOVE)
  3029.             )
  3030.         )
  3031.  
  3032. (complete 95)
  3033.         (working #replace-enforcer)
  3034.  
  3035.         (set #rplc "(Enforcer|CyberGuard)")
  3036.  
  3037.         (if (<> (bitand #toolmask #muforce-mask) 0)
  3038.             (
  3039.                 (set #dest (tackon #mutool-path "MuForce"))
  3040.                 (P_PATCH_REPLACE)
  3041.             )
  3042.             (
  3043.                 (P_PATCH_REMOVE)
  3044.             )
  3045.         )
  3046.  
  3047. (complete 96)
  3048.         (working #replace-memsniff)
  3049.  
  3050.         (set #rplc "(GuardianAngel|MemSniff|MungWall|CyberPatcher|OxyPatcher|WipeOut)")
  3051.         (P_PATCH_REMOVE)
  3052.  
  3053.         ;this is done at MM4K installation already!
  3054.         ;(working #replace-prepemul)
  3055.  
  3056.         ;(set #rplc "PrepareEmul")
  3057.         ;(P_PATCH_REMOVE)
  3058.  
  3059. (complete 97)
  3060.         (working #replace-setcachemode)
  3061.  
  3062.         (set #rplc "SetCacheMode")
  3063.         (if (<> (bitand #toolmask #musetcache-mask) 0)
  3064.             (
  3065.                 (set #dest (tackon #mutool-path "MuSetCacheMode"))
  3066.                 (P_PATCH_REPLACE)
  3067.             )
  3068.             (
  3069.                 (P_PATCH_REMOVE)
  3070.             )
  3071.         )
  3072.  
  3073. (complete 98)
  3074.         (working #replace-speedychip)
  3075.  
  3076.         (set #rplc "SpeedyChip")
  3077.         (if (<> (bitand #toolmask #mufastchip-mask) 0)
  3078.             (
  3079.                 (set #dest (tackon #mutool-path "MuFastChip ON \\>NIL:;"))
  3080.                 (P_PATCH_REPLACE)
  3081.             )
  3082.             (
  3083.                 (P_PATCH_REMOVE)
  3084.             )
  3085.         )
  3086.  
  3087. (complete 99)
  3088.         (working #replace-fastexec)
  3089.  
  3090.         (set #rplc "(FastExec|SetMemMode|SetFastAvec)")
  3091.         (P_PATCH_REMOVE)
  3092.  
  3093.     )
  3094. )
  3095.  
  3096. (complete 100)
  3097.  
  3098. ;==we're done==================================================================
  3099. ;
  3100. (TERMINATE)
  3101. (exit #exit-text)
  3102.